Ubuntu

[feisty] NetworkManager forgets statically configured domain

Reported by packet on 2007-03-30
8
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Low
Unassigned

Bug Description

I am using Kubuntu Feisty Fawn and I cannot set the domain (as in resolv.conf's "domain" keyword) persistently via knetworkmanager. It seems like knetworkmanager appends the domain to resolv.conf, but NetworkManager regenerates resolv.conf when started. What happens is the following:

1. Configure domain: knetworkmanager->Static Connection...->Domain Name System->Domain name
2. Examine resolv.conf: The entry "domain" is there and correct
3. Restart networking: sudo /etc/init.d/networking restart
4. Examine resolv.conf: "domain" is missing

My current workaround is to deinstall knetworkmanager and network-manager.

Brian Murray (brian-murray) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. When you execute '/etc/init.d/networking restart' that does not restart network-manager. Why exactly are you restarting networking? Thanks in advance.

packet (packet) wrote :

I know it does. I just mentioned it as a way to reproduce the bug without rebooting. Of course, rebooting also triggers the bug.

Jonathan Jesse (jjesse) wrote :

Hopefully assigning this against the correct pacakage, pleaes let me know if i didn't

have a great night :)

vijay (vijay-santhosh) wrote :

Network-manager reconfigures resolv.conf when its initialized. This causes the previous configuration in resolv.conf to be lost. One of the related bugs is
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/37239

The problem will be solved if NetworkManager does not alter resolv.conf during its start-up or it modifies only select properties like "nameserver" and leave the other properties like "domain" unaltered.

Changed in knetworkmanager:
assignee: brian-murray → nobody
importance: Undecided → Low
status: Needs Info → Confirmed
Shawn Church (sl-church) wrote :

I found this bug (and bug https://bugs.launchpad.net/ubuntu/+source/gnome-system-tools/+bug/72341) while researching a similar problem. It turned out that dhclient was modifying resolv.conf every time my ISP connection was established. I fixed this by modifying /etc/dhcp3/dhclient as follows (removing the domain and
host names from the "request" line):

=== modified file 'dhcp3/dhclient.conf'
--- a/dhcp3/dhclient.conf 2008-01-14 02:03:39 +0000
+++ b/dhcp3/dhclient.conf 2008-01-14 17:36:02 +0000
@@ -16,9 +16,8 @@
 #send dhcp-lease-time 3600;
 #supersede domain-name "fugue.com home.vix.com";
 #prepend domain-name-servers 127.0.0.1;
-request subnet-mask, broadcast-address, time-offset, routers,
- domain-name, host-name,
- netbios-name-servers, netbios-scope;
+request subnet-mask, broadcast-address, time-offset, routers;
+
 #require subnet-mask, domain-name-servers;
 timeout 30;
 #retry 60;

Before this change I could modify the domain name in network manager and see the changes in /etc/resolv.conf
along with a comment saying that the file was modified by network manager (DO NOT EDIT!!!!). However when networking was started or restarted (i.e. /etc/init.d/networking restart or system boot) then resolv.conf would be overwritten,(including the comment line). After the change shown above resolv.conf is not modified.

Hope this helps

Alexander Sack (asac) wrote :

Networkmanager 0.7 should support all kind of tweakage now.

Changed in network-manager:
status: Confirmed → Fix Released
kyosen (oscarfs) wrote :

I use Ubunutu 8.04 and I've solved this bug editing /etc/init.d/networking.

Put just before last line (exit 0) this command:

echo "domain yourDomainName" >> /etc/resolv.conf

Alexander Sack (asac) wrote :

fwiw, you can use resolvconf in intrepid to configure this behaviour

kyosen (oscarfs) wrote :

Sorry, I did some test with the configuration above but without rebooting. When I reboot "resolv.conf" becomes the original file without the domain name so I figure out that this file is generated later.
So, the solution is putting de line

echo "domain yourDomainName" >> /etc/resolv.conf

in the file: /etc/network/if-up.d/avahi-daemon

I'll hope it would be useful.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers