Super User is a question and answer site for computer enthusiasts and power users. 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 have a following issue. I have in house server (old Dell desktop PC). I have about 9 devices I'm using to test my websites (written mainly in PHP and Python).

In the past, I was creating Nginx virtual hosts and was editing hosts file to point virtual subdomain to my main server, ex.,

With lot of devices and websites it became really hard to manage it (+ I don't know how to edit hosts files on Android and iPad tablets).

I'm wondering (however my knowledge in that aspect is quite limited) if it's possible to set up DNS server (Bind9?) on my server and point its IP as the second NS in my internet connection? Would that work? If not, how do you usually manage that kind of stuff?

Regards, Kyriagos

share|improve this question
up vote 2 down vote accepted

I set up a local DNS server as a forwarding-only server, give it the address of your ISP's nameservers. Then add a local domain to it's config. Add the necessary forward and reverse records for each local name you want to use on the web-server.

Set all the PCs to use the local DNS server. (Ideally using DHCP)

Then when PCs ask for the address of (computer foo in your local domain, your local DNS server knows it is authoritative for that domain and gives the answer itself.

For any other query, the local nameserver forwards the query to your ISP's DNS server (or whatever you configure as a more knowledgable DNS server).

share|improve this answer
I've found interesting article on forwarding DNS server with bind. I have just one, small question: in my internet connection box, I have my modem-router ( as my primary DNS server. Should I add my server IP as the second server or primary and add router IP as secondary DNS? Some of those devices need to work outside local network too. Sorry for silly questions, just trying to understand everything and learn that stuff. – Kyriagos Aug 21 '12 at 19:54
@Kyriagos: Clients are configured with a list of DNS servers. Normally only the first in the list is consulted. The others are only used if the first one is not available (turned off or inaccessible), all the listed DNS servers are expected to have exactly the same information available to them. The client does NOT consult a second DNS server just because the first one returns an answer such as "no such domain" for example. So make your DNS server the only one in the list. If you want secondaries you have to set up more local DNS servers which perform zone-transfers from the primary. – RedGrittyBrick Aug 21 '12 at 22:33
Thanks. Learned new stuff. Love to have my problems solved that way. I've set up local DNS server, everytihng is working perfectly. – Kyriagos Aug 22 '12 at 12:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .