NetworkManage does not set domain in /etc/hosts on DHCP connections
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
network-manager (Ubuntu) |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Binary package hint: network-manager
When NetworkManager start a DHCP connection it sets IP and hostname in /etc/hosts, but it does not include the FQHN. Without the FQHN in /etc/hosts Kerberos and AD integration with windbind do not work.
Example: After setting up a DHCP connection NetworkManager adds this line on to of /etc/hosts
161.42.184.214 wkjpvtest # Added by NetworkManager
For Kerberos and winbind to work correctly, the line should be:
161.42.184.214 wkjpvtest.
The following short NetworkManager hook, solves the problem for me now:
#!/bin/sh -e
# Dirty hack to set the FQHN in /etc/hosts for DHCP connections managed
# by NetworkManager, install it in /etc/NetworkMan
HOST=`hostname`
DOMAIN=`grep domain /etc/resolv.conf | cut -d' ' -f2`
# first check if the domainname is already set
if ! grep -q "$HOST.$DOMAIN" /etc/hosts ; then
# if not, correct /etc/hosts to include the FQHN
sed -e s/"$HOST.*# Added by NetworkManager.
mv -f /tmp/hosts.new /etc/hosts
fi
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: network-manager 0.8.1+git.
ProcVersionSign
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
CRDA: Error: [Errno 2] No such file or directory
Date: Wed Oct 13 12:12:00 2010
Gconf:
IfupdownConfig:
auto lo
iface lo inet loopback
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
IpRoute:
161.42.184.0/24 dev eth0 proto kernel scope link src 161.42.184.214 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000
default via 161.42.184.1 dev eth0 proto static
IwConfig:
lo no wireless extensions.
eth0 no wireless extensions.
Keyfiles: Error: [Errno 2] No such file or directory
ProcEnviron:
LANG=de_DE.utf8
SHELL=/bin/bash
RfKill:
SourcePackage: network-manager
ftp_proxy: http://
http_proxy: http://
I can confirm this issue and at least one problem that it is causing: https:/ /bugs.launchpad .net/duplicity/ +bug/662334
Listed below are the differences in 10.10 and 10.04 behavior. localdomain localhost localdomain6 localhost6
- - - - - - - - - - - - - - - - - - - - - - - - - - -
10.10
$ cat /etc/hosts
xxx.xxx.xxx.xxx ubuntu # Added by NetworkManager
127.0.0.1 localhost.
::1 kanpai localhost6.
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
- - - - - - - - - - - - - - - - - - - - - - - - - - -
10.04
$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu.example.com ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
- - - - - - - - - - - - - - - - - - - - - - - - - - -