Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a gateway running on Debian Squeeze with 2 network interfaces, one static (internal, eth0) and one DHCP (external, eth1). I have an internal DNS server that I want the gateway to use.

In my /etc/network/interfaces, I have eth0 set to static, with a dns-nameserver directive, pointing to 192.168.3.4. However, upon rebooting or restarting the networking service, my /etc/resolv.conf changes to the DNS server provided by the external DHCP.

How can I get Debian to use my internal DNS server but still obtain a DHCP lease from eth1?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

One option would be to adjust your /etc/dhcp/dhclient.conf file to simply not request the domain-name-servers and domain-name DHCP options.

You mention that you provided the dns-nameserver option in your interfaces file. Do you actually have the resolvconf package installed? If not, then that setting isn't going to do anything useful, and DHCP will pretty much always over-write the resolv.conf if DNS options are recieved.

If the resolvconf package is installed you can modify the interface-order config to control the order the settings are used.

share|improve this answer
    
Thanks for the help! –  Ian Unruh Feb 13 '12 at 20:59

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.