1

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!

1

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.

  • 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
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.