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'm having trouble trying to find anything on the internet explaining how to do this...

I'm running Ubuntu 14.04 with repository current Bind9

I have a authoritative DNS server hosting my domain and my web/mail server on my network behind a single static external IP address that is shared by all the other computers in the building.

I have a DNS caching setup on a 2nd machine for all my out going DNS requests and I would like it so that when I type, the DNS cache will give the internal IP of the web-server instead of the external IP.

I haven't been about to find any information on how to do this, but I don't think I'm searching for the correct terminology.

i tried just adding the addresses to the /etc/hosts file and this doesn't work for the rest of the network.

i don't know where to look from here, can anyone point me in the correct direction.


share|improve this question

The search term you're looking for is "split DNS" or "split views". It's generally regarded as a bad idea due to the management headaches that end up being created by it in the long term.

You may wish to consider creating a privately forwarded subdomain that is not exposed on the internet. (i.e., something under a domain you own) Put your DNS records for private IP addresses in this domain. It will not solve the problem of making selectively return the private IP -- this should usually be solved on individual systems -- but it will at least give you dedicated DNS records for your private network.

share|improve this answer
this certainly solves some of my problem, but i use virtual hosting for multiple sites.. ie:,, i supose i can put up with it... i was just hoping i had a solution – RandomOzzy Jul 17 '14 at 2:25
I've had to use it before and it works fine. I'm not sure what management headaches Andrew is referring to. – Matt Jul 17 '14 at 2:56
I use split DNS for my home and work network. If the volume of records is small it's not horrible to manage, but you gave to remember... – uSlackr Jul 17 '14 at 3:01
if the private network does not have internet access, why not just overload the A address for so that it has two A addresses: the internal, and the external. the browser should discard the internal IP, and fail over to the public IP. and vice versa. so long as you use a private IP in a Subnet that is not commonly used by LANs, things should be fine? – RapidWebs Jul 17 '14 at 6:36
@RapidWebs An application doing anything other than using the first DNS record returned in a round robin set is implementation specific behavior. You never rely on implementation specific behavior in production. Also see:… – Andrew B Jul 17 '14 at 19:52

You can use Unbound which supports exactly what you want to do. It would replace BIND, and your configuration would look something like this;

local-zone: "" transparent local-data: " IN A" local-data: " IN A" local-data: " IN A"

What this does;

  1. Define the zone ''.
  2. transparent refers to a mode that will pass through to external/forwarder nameservers if it doesn't have a local-data record that matches.
  3. local-data defines the records you'd like to override internally. could have an external IP address of, but to any clients using this DNS server, it would appear to them as

I've used this several times before on large office networks, and it works flawlessly. You can also define many local-zone definitions to override as many domains as you would like.

share|improve this answer

Your Answer


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.