I need to test a few websites on my local network.

I've already setup a DNS server with bind9 for my internet domains, and that works.

I can also add a few domains to the /etc/hosts file, so I can test various sites with virtual name based hosting on the local machine.

Now, I've to test various browsers, which means I will be on various machines (e.g. Windows for IE testing).

I don't want to always have to edit the hosts file on these machines. I want to use the dns server to centrally administer the domains, and just put the DNS server into each machines' config.

How can I add this DNS server to my Ubuntu 12.04 machine, so the lookup order goes like this:

  • hosts file
  • MY dns-server
  • ISP dns-server

What I want to do is add www.something.tld or to the DNS-server, and then be able to test these domains from every computer in the local network that uses this dns server (windows, linux).

The thing is, I don't have www.something.tld registered, this is just for testing purposes. To make sure everything really works.

Basically, I want to resolve a custom domain name or host name to a 192.168.1.x address.

Where do I have to put my DNS server for that ?


The way to achieve this is to configure your NS appropriately - your clients know only about your (own) default NS.

Every name server can be configured to "forward" inquiries it cannot answer to some other NS. For example (taken from http://www.akadia.com/services/howto_forward_dns.html), I omitted the forward first statement, as you don't want that.

options {

  forwarders {;

Not sure if this will help you, but it worked for me for what seems to be a very similar situation. I am running a headless Raspberry Pi and wanted to log in using a name rather than an IP address. On my router (, I first set the IP of the RPi as Static. Next, I went to the setting for Static NAT in the Firewall section. Here there is a table with fields for "Networked Computer/Device" and for "Public IP Address". I set the RPi's name to correspond to the static IP address I had already set. In order to make sure the NAT would happen, I checked that all my computers' network settings had as the first DNS server. (It may already be set that way by default.) I am using mostly OSX--the DNS setting can be found in Network in System Preferences--click the "Advanced" button and select the "DNS" tab. My router is for Verizon FiOS (Westell A90-9100EM15).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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