Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local host on caching DNS server 1

Status
Not open for further replies.

AEShier

IS-IT--Management
Apr 10, 2002
18
US
I have my Linux box set up as a caching-only DNS, but I need to set up some exceptions. If other machines try to access certain hostnames (i.e. mail.mydomain.com), then I want to route them to an internal IP address. Any other addresses need to be resolved by my ISP's DNS (as set up in my resolv.conf file).

Any help would be greatly appreciated.

Thanks,

Adam
 
Do all of your clients use the caching name server as their default name server in /etc/resolv.conf?

"Any other addresses need to be resolved by my ISP's DNS (as set up in my resolv.conf file)." --> Do you have both your internal caching server and your ISP's name server in resolv.conf? This isn't how its done. You should set up forwarders on the caching servers /etc/named.conf.

forwarders {
192.168.0.10;
192.168.0.20;
192.168.0.30;
};
forward only;


As for the exceptions, can you use the /etc/hosts file for these?


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 
My internal caching server has an internal IP address of 192.168.1.19. All of my clients (which are Windows clients) have 192.168.1.19 as their DNS server address. The /etc/resolv.conf file on my caching server contains the DNS addresses from my ISP (204.177.184.10 & .15). All of my clients resolve properly. However, when I try to put the exceptions into the /etc/hosts file on my caching server, my clients still resolve to the external address that is registered with the ISP's DNS rather than the internal address entries that are in the /etc/hosts file on my caching server.

I could probably set up the hosts file on each of my clients to contain the exceptions, but I would prefer to maintain those addresses in one place.
 
I don't know if this will work as I think you need to use the hosts file on the workstations, not the server, but you can try editing the lookup order. To change the lookup order, edit the /etc/host.conf file. The line order hosts, bind specifies that the /etc/hosts takes precedence over the name servers.

You shouldn't list your ISP's servers in resolv.conf. You need to use the forwarders commands I showed you above in /etc/named.conf.

If the above doesn't work, can you just host your internal domain on your name server and forward all other requests to your ISP's server?

ChrisP ------------------------------------------------------------------------------
If somebody helps you, please vote for them for "Tipmaster of the Week" by giving them a "purple star". This can be done by clicking the "Mark this post as a helpful/expert post" button.
 

Well, I got this working, but I had to take your last piece of advice and set it up to host my internal domain.

The reason I was doing all of this is because of deficiencies in my firewall box. We are using static NAT to get to our mailserver from the firebox. I have some sales guys that sometimes work from our internal network and sometimes dial into their ISP's. If they try to get their pop3 mail while connected to the internal network, and our mailserver name resolves to external ip address, it doesn't work. So, I am trying to set it up so that when they are connected internally, they resolve to the internal address, and when they are connected externally, they resolve to the external address.

I think I got it now.

Thanks for your help,

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top