Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I got a preconfigured debian image that gets it's network configuration by DHCP, however the DNS server is/was fixed to 8.8.8.8. This was configured using /etc/resolv.conf, so I deleted all the entries there. /etc/dhcpc/resolv.conf contains the DNS server I would like to use, however this DNS server isn't used by the system. How do I activate the usage of the DNS server provided by DHCP? Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I ended up installing isc-dhcp-client, seems to fix the problem. Thanks for all the other hints, though!

share|improve this answer

ln -sf /etc/dhcpc/resolv.conf /etc/resolv.conf

Explanation:

The system will look only in /etc/resolv.conf for nameservers. What the above command does is it creates a symbolic link /etc/resolv.conf to the file /etc/dhcpc/resolv.conf. In effect, when opening /etc/resolv.conf you actually open the file /etc/dhcpc/resolv.conf. And I take it that file contains the information you want your system to use.

share|improve this answer
    
thanks for your reply, nice idea that would do the job. What I am wodnering about: is this the default way how it's done in common linux distributions? –  stefan.at.wpf Jun 15 '12 at 14:15
    
@stefan.at.wpf for debian install the resolvconf package –  Ulrich Dangel Jun 16 '12 at 1:57
    
Nowadays in most common linux distributions network related stuff is managed by the "network-manager". The network manager modifies the file /etc/resolv.conf and fills it with whatever it thinks should be in there. In the past tools like dhclient and alike used to write to /etc/resolv.conf directly. –  Bananguin Jun 16 '12 at 4:57

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.