I got a PC that I'm not using and it has some power.. I wanna have my own DNS server like a ISP has.. How can I go about this? I know linux so that's no biggy.. Thought this would be something fun to do :D
6 Answers
This is a little confusing since you describe another setup than you mention in the topic.
First Local DNS Caching
This is pretty easy to achieve using dnsmasq
To set this up install the dnsmasq package of your distribution. Since Debian based systems are common these days I'll assume this distro.
$ apt-get install dnsmasq
Now edit /etc/dnsmasq.conf and set the listen-address directive to the IP address of the network interface connected to your network.
Now restart the dnsmasq service
$ /etc/init.d/dnsmasq restart
Edit your resolv.conf and enter the nameservers supplied by your providers or another one:
# Google DNS 1
nameserver 8.8.8.8
# Google DNS 2
nameserver 8.8.4.4
Now you can set your Linux machine as DNS server of your LAN clients and use DNS caching.
To test if it is working you might use dig
$ dig example.com
You will see something like
;; Query time: 38 msec
Now type the command again, and you should see something like:
;; Query time: 2 msec
ISP like real DNS Server
This would be possible using real nameserver software like bind. But if you have no experience on this you should probably start reading ahead at bind9.net since this would be to broad to answer.
- 3,853
There are only two caching recursive DNS servers that I can strongly recommend (avaiable both for Windows and UNIX variants)
- BIND (http://www.isc.org/)
- Unbound (http://www.unbound.net/)
The particular reason I recommend these two is DNSSEC - they both have full DNSSEC validation built-in. You won't get that with dnsmasq or tinydns.
BIND is generally considered to be the reference implementation of DNS, although I'd note that because it's a full general purpose DNS server it has lots of knobs and settings that a recursive-only server doesn't need.
Unbound was designed from the ground up to be recursive only. It's fast and lightweight.
- 21,641
Bind is the most popular: http://www.isc.org/software/bind
If you want something for windows, Windows Server has a DNS Server built in.
Not sure why you would want a local DNS server, it wont speed up DNS lookups necessarily. Keep in mind the DNS server has to run multiple queries before resolving to the IP. At a DSL or even cable, they will be slower than a DNS server at a datacenter with big pipes....
- 506
You kinda need a server OS to do that (as of what I know). I would install Windows Server (preferred 2003+) and install the DNS role. It has a nice little wizard that will help you set up your own DNS server.
I know that this isn't the only way, but it is a way that I am very familiar with.
-Good Luck
- 194
Something cool and fast is TinyDNS/DNScache
its very simple to configure and maintain..
But by far for your needs..
I would suggest dnsmasq.. it will do the job your looking for..
Hope this helps :D
- 3,608
It's probably not worth it. Your server will still have to rely on an authoritative nameserver, and you probably won't have a connection to that authority that's nearly as fast as dedicated DNS servers such as what Google provides.
A couple of other things to consider: Most computers actually cache DNS entries locally for a certain period of time anyway. Furthermore, some modern browsers are now "prefetching" DNS info for links on a page - Google Chrome for example.
By the way - here is another post that provides a good answer should you still want to continue "for fun." in house DNS server