[network-admin] setting domain name changes localhost alias only for the first time

Bug #72341 reported by Kamil Páral on 2006-11-18
8
Affects Status Importance Assigned to Milestone
gnome-system-tools (Ubuntu)
Undecided
Unassigned
Nominated for Hardy by Jonathan
Nominated for Intrepid by Jonathan

Bug Description

Binary package hint: gnome-system-tools

Ubuntu Edgy.

If you run System->Administration->Networking, tab General, you can set host name and domain name.

Let's suppose we have set host name to "HOST" and domain name is empty.

In tab "Hosts", there are now items:
127.0.0.1 localhost HOST
127.0.1.1 HOST

Now, set domain name to "DOMAIN".

In tab "Hosts", there are now items:
127.0.0.1 localhost HOST.DOMAIN
127.0.1.1 HOST.DOMAIN

Now, set domain name to "NEWDOMAIN".

In tab "Hosts", there are still items:
127.0.0.1 localhost HOST.DOMAIN
127.0.1.1 HOST.DOMAIN
No change has been applied.

Now, clear domain name (set it to empty line).

In tab "Hosts", there are still items:
127.0.0.1 localhost HOST.DOMAIN
127.0.1.1 HOST.DOMAIN
No change has been applied.

As you can see, the localhost aliases are changed only when the domain name is set *for the first time*. This can be causing some difficulties (and it does in my case).

Expected behaviour:
Localhost aliases should update according to the domain name every time.

description: updated
Kamil Páral (kamil.paral) wrote :

Still an issue in Ubuntu 7.04. Though it changes only line 127.0.1.1, not the 127.0.0.1 one.

Unifier (public-bob) wrote :

I was about to ask for help in the Ubuntu forums about Ubuntu Gutsy "forgetting" the domain name in the general tab in the network settings. I have to retype "mshome" every time I boot up the OS in order to connect to my wireless network. Does this bug have anything to do with this?

Kamil Páral (kamil.paral) wrote :

Unifier: I don't think so. If you want to set microsoft network workgroup, use system → administration → shared folders → general → workgroup. I don't have english system, so some names may not be exactly correct.

Unifier (public-bob) wrote :

It seems that other computers can access my files on Ubuntu, but Ubuntu can't access files from my other computers until I type "mshome" in the general tab after clicking on "Network" in the menubar. It goes blank after every shutdown.

Shawn Church (sl-church) wrote :

I found this bug (and bug https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/98928?redirection_url=https%3A%2F%2Fbugs.launchpad.net%2Fubuntu%2F%2Bsource%2Fnetwork-manager%2F%2Bbug%2F98928) 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

Shawn Church (sl-church) wrote :

Oops, bad link to related bug in previous post. Correct link is https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/98928

Pedro Villavicencio (pedro) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue that you reported is one that should be reproducible with the live environment of the Desktop CD of the development release - Hardy Heron. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at http://www.ubuntu.com/testing/ . Thanks again and we appreciate your help.

Changed in gnome-system-tools:
status: New → Incomplete
Kamil Páral (kamil.paral) wrote :

Yes, the problem persists in Hardy Heron Alpha 5 (with the exception, that it's no longer modifying the 127.0.0.1 line, only the 127.0.1.1). Even worse, I wasn't able to change the domain name in the domain name field. It worked once or twice and after that, every time i changed domain name, after reopening the dialog there was the old value.

Changed in gnome-system-tools:
status: Incomplete → Confirmed
Unifier (public-bob) wrote :

Shawn, could you walk me through your modifications? Is that what your dhclient.conf file actually looks like or are the pluses and minuses supposed to represent additions or removals from the file? Here's what mine looks like (it should also be worth mentioning that I can't trigger my bug with sudo /etc/init.d/networking restart, only with an actual reboot):

# Configuration file for /sbin/dhclient, which is included in Debian's
# dhcp3-client package.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#

send host-name "<hostname>";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#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, domain-name-servers, host-name,
 netbios-name-servers, netbios-scope;
#require subnet-mask, domain-name-servers;
timeout 30;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/etc/dhcp3/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;

#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}

#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}

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

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.

Wingman (mikywing) wrote :

I confirm this bug is still present in Ubuntu 8.04.2 Hardy Heron. It's very annoying to see it in a LTS environment...

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

Other bug subscribers