0
votes

Is this at all possible if so how? BIND to resolve servers in intranet and internet for the same domain

Scenario

zone is example.com

i have one server server1.example.com but it is located on a virtual private server on the cloud in the internet.

I have the domain exmaple.com bought at godaddy. hence the nameservers for example.com are of godaddy.

I have added a A record in godaddy for server1.example.com to point to the public ip of the VPS.

Now at my home (intranet) i have setup a BIND DNS server having ip 10.10.10.100.

And have added the zone example.com to it.

Have then added A record for server22.example.com and ipaddress being 10.10.10.10 in my BIND config.

Now from a laptop inside my home network, i am able to resolve server1.example.com; probably the global dns are resolving this address for me.

Laptop's DNS config is as below

DNS1: 10.10.10.100

DNS2: 4.2.2.2

DNS3: 8.8.8.8

However i am NOT able to resolve server22.example.com which is inside my intranet.

I Guess when i tried to resolve server22.example.com. DNS1:10.10.10.100 should have resolved it for me, since that is first in my list, and it knows what is the the ipaddress of server22.example.com

But unfortunately it is not. What is that i am doing wrong ?

How can i fix this ?

1

1 Answers

1
votes

The easiest way to solve this is to put the names that need non-Internet resolution in /etc/hosts:

10.10.10.10 server22.example.com

(The file is usually C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS on Windows machines)

If you insist on having the DNS server do it, one solution is to have two BIND servers; one is for the internet at large and doesn't have the server22.example.com record. The intranet private BIND server should start with the same zone file, but with the record for server22.example.com added to it.

Another option is to use "split horizon DNS" with BIND: http://www.zytrax.com/books/dns/ch6/#split-view