Bug 29999 - dhclient overwrites resolv.conf
dhclient overwrites resolv.conf
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Network
UCS 3.1
Other Linux
: P5 normal (vote)
: UCS 3.1-0-errata
Assigned To: Stefan Gohmann
Janek Walkenhorst
:
Depends on:
Blocks: 29885
  Show dependency treegraph
 
Reported: 2013-01-10 21:28 CET by Stefan Gohmann
Modified: 2013-01-15 15:19 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-01-10 21:28:16 CET
dhclient overwrites the resolv.conf with the DNS server given via DHCP. When ifup/ifdown will be used to configure the interface everything works fine, because /etc/network/if-up.d/00_resolvconf writes the given DNS server to dns/forwarder and so on.

If the lease expires, dhclient will be executed and the resolv.conf contains only the given DNS server.

Workaround:

cat >>/etc/dhcp/dhclient-enter-hooks.d/resolvconf <<__HERE__
#!/bin/bash
ucr commit /etc/resolv.conf
__HERE__

The real fix should check that the nameserver given via DHCP will be set as dns/forwarder at least on a DC.
Comment 1 Stefan Gohmann univentionstaff 2013-01-15 09:04:37 CET
A new dhclient-exit-hooks.d has been added:
 /etc/dhcp/dhclient-exit-hooks.d/resolvconf

It checks similar to /etc/network/if-up.d/00_resolvconf the /etc/resolv.conf. If a nameserver was given via DHCP this nameserver is added to the dns/forwarder* list. And the resolv.conf is re-created with the nameserver from UCR.
Comment 2 Janek Walkenhorst univentionstaff 2013-01-15 13:57:19 CET
Tests:
 Fehler wird durch Installation des Paketes behoben, beim renew wird die Datei wieder korrigiert und die Nameserver als forwarder eingetragen.

Advisory: OK
Comment 3 Moritz Muehlenhoff univentionstaff 2013-01-15 15:19:09 CET
http://errata.univention.de/3.1-errata17.html