Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

DNS-server for local domains

7:19 am on Jul 13, 2013 (gmt 0)

New User

10+ Year Member

joined:Mar 24, 2005
posts: 14
votes: 0

Hi friends,

I have two FreeBSD servers.
Server 1 is DNS.
Server 2 is Apache.

I have a public sub-domain as I have pointed to my public IP address (A record) and made NAT from ZyXEL NBG4615 router on port 53 and 80 to server 1
I have created a zone file on server 1, and when I do nslookup I get the local IP address of the server 2 return.
I've tried to do NAT on port 80 directly into the server 2 It works without problems.
And when I from a PC on the network, manually place the server 2 as DNS and do nslookup again so I can see the call server 1 and returns Server 2's IP address.

When I type sub-domain name I am sent to my public IP address. Then I hit server 1 And then it has to send me to the server 2 (because it is in the zone file). But it does not.
I turned off all firewall's from, but without success.

What remains for me to do, or what have I done wrong?
7:27 pm on July 13, 2013 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member dstiles is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:May 14, 2008
votes: 8

Not really familiar with managing DNS servers but guesses:

Caching from previous access

hosts file on the querying computer has an entry for the subdomain

subdomain not in DNS list - a subdomain has to be separately specified for an IP (in my experience)

if the subdomain is listed in another (eg external/public) DNS server then routing becomes important - the public server may take precedence.

Warning: be very careful about potential access by baddies - some DNS setups are very easy to crack and poison or subvert. But you already knew that! :)
8:07 pm on July 13, 2013 (gmt 0)

Full Member

5+ Year Member

joined:Aug 16, 2010
votes: 19

I think it is your dns search order in /etc/host.cnf.

default it is: order hosts,bind
change it to: order bind, hosts

now the dns server will looked up first.