Closing as won't fix, here's why:

We can' t change /etc/hosts, it's very dangerous, prone to errors, and
just tends to cause major headaches for everybody. It's been tried on
Maverick IIRC, and it's been completely reverted and ripped out of NM
since, the decision being made by upstream in collaboration with a few
Ubuntu developers and Debian developers.

As mentioned above, what you're getting from DHCP is not an actual
domain name you're on (or actually, not *necessarily*, which makes it
often wrong to set it in /etc/hosts unless you know what you're doing.
/etc/hosts is normally set at install time with the correct hostname and
domain name if necessary, by the admin; entries other than 127.0.0.1,
127.0.1.1 and the ipv6 ones, as stated above, should be all that appears
in /etc/hosts.

If you're in a system that requires the domain name like this, it's
probably not likely to change location or IP frequently, and the above
settings take care of that. If you're on a mobile system, then the
domain name always changes anyway (and you're most likely usually not
going to have your system available from the net anyway, which would be
the usual use case for having the domain name set).

Additionally and as a workaround if you're not yet convinced, if you're
using this on a laptop with Apache or whatever: even if it's not a full
FQDN things should still work. Systems will usually be available through
MDNS anyway, so reachable via their hostname on the .local domain as
well (which is something that can be made us of in Apache and other
apps). There has been various discussions on the subject already, on
bugs and mailing lists.

And finally, an excerpt from the dnsdomainname man page, section THE
FQDN:

       Technically: The FQDN is the name getaddrinfo(3) returns for the
host name returned by gethostname(2).  The DNS domain name is the part
after the first dot.

       Therefore it depends on the configuration (usually in
/etc/host.conf) how you can change it. Usually (if the hosts file is
parsed  before  DNS  or  NIS)  you  can  change  it  in  /etc/hosts.

       If  a  machine  has  multiple network interfaces/addresses or is
used in a mobile environment, then it may either have multiple
FQDNs/domain names or none at all. Therefore avoid  using hostname
--fqdn, hostname --domain and dnsdomainname.  hostname --ip-address is
subject to the same limitations so it should be avoided as well.


... and there's a reasonable workaround provided in comment #5.

Ooof. Sorry if this seems a bit rash, it's not the intent. I'm just
explaining why we won't be fixing this in NetworkManager, and so the
response can be kept as a reference :)

** Changed in: network-manager (Ubuntu)
       Status: Confirmed => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/659817

Title:
  NetworkManage does not set domain in /etc/hosts on DHCP connections

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/659817/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to