Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to run my own DNS server in my laptop for learning purpose. I recently used Google Public DNS and liked it. I wanted to build some thing similar and small for my web browsing.

What I vaguely dream of is to use my own DNS server as Primary DNS server and Google public DNS as secondary DNS server. I would like to build my own DNS server gradually by editing the configuration files (If it can be automated it will be great, but have no clues there).

Sometimes it sounds like a stupid idea to me, but I am fine with editing config file for each site I want to add to my DNS server. Any pointers/suggestion is welcome.

share|improve this question

closed as off topic by Iain Feb 8 '12 at 21:25

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

There are two things called a "DNS server" which you should separate in your mind:

  1. There is the DNS server for a domain (or "zone") which serves all of the Internet with information about names in that domain (excluding any subdomains, which is why it's called a "zone").

  2. A DNS resolver, which is what OpenDNS and the newly started Google "DNS server" is. This is the server which "resolves" any and all domain names into IP addresses, for you. This is typically supplied for you by your ISP, and automatically provided via DHCP along with your IP address.

Now, both of these things are done by most DNS server software, including BIND, but you need to think separately about these concepts.

If BIND is to work as a DNS resolver, it needs to have "recursion yes;" set. Otherwise, it is recommended, but not strictly necessary to have it turned off.

share|improve this answer

You kind of have your own DNS server anyway - your DNS client acts as a caching server and your HOSTS file acts as a name server...

In any case if you are running a Mac or Linux - then download and install BIND - play with that. You change the config, download the source and tinker to your hearts content.

If you are running Windows then Simple DNS Plus might work for you.

share|improve this answer

There are various articles like this one out on the internet on how to setup bind in caching mode, basically its easy because it does that by default:

If you set up bind and point it at some forwarders it will by default cache requests. To test its working, dig the same address twice (something that you haven't already visited recently) and the first request will show flags "aa" (authorative answer). The second wont, indicating it came from cache. The article above shows this in more detail.

Note if you are running linux you get the same benefit installing and running "nscd" daemon. Most modern OS's will have this or some equivalent caching daemon installed for you by default.

Setting up DNS zones is not too hard and you should start editing the files by hand. Automation is totally unnecessary unless you are editing the files frequently.

share|improve this answer

I run Linux and I have BIND installed already. Is there any way to automate the DNS server update.

  1. Type in browser
  2. My DNS server does not have
  3. It goes to secondary DNS server (Google Public DNS server)
  4. Resolves
  5. Automatically update my DNS server with details.

This way my DNS server will be populated with all the sites I visit first time.. second time the resolution will be faster because its already cached.

Its like automated offline DNS cache.

share|improve this answer
Is there some reason you didn't add this to your original question? – Zoredache Mar 30 '10 at 5:50
No specific reason as such. – user39184 Mar 30 '10 at 6:16
This is a rather pointless request: a) your local DNS cache does this for you already b) your DNS server would then have to observe TTL times, which is also already handled by your local DNS cache. c) most DNS servers handle zone replication, but only to defined slaves. There are plenty more reasons... – wolfgangsz Mar 30 '10 at 9:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.