Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ?

share|improve this question
add comment

2 Answers

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 {
    193.247.122.26;
  };
  ...
share|improve this answer
add comment

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 (192.168.1.1), 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 192.168.1.1 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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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