resolv.conf loses search directive with domain during pxe boot

Bug #974454 reported by Mac Welch
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
netcfg (Debian)
New
Unknown
netcfg (Ubuntu)
Confirmed
Undecided
Unassigned
Bionic
Confirmed
Undecided
Unassigned

Bug Description

[Impact]

 * netcfg currently ends up overwriting DNS search domains provided by correctly configured DHCP servers in the installer environment.

 * Any preseed command that relies on hostname resolution via a search domain fail at runtime.

 * The change in this bug allows netcfg to detect that the DHCP-server provided a domain.

[Test Case]

 * TBP

[Regression Potential]

 * TBP

[Other Info]

 * Anything else you think is useful to include
 * Anticipate questions from users, SRU, +1 maintenance, security teams and the Technical Board
 * and address these questions in advance

[Original Report]

When performing a pxe boot using the netboot image from the precise-server-amd64 iso, resolv.conf is modified and the search directive containing the domain provided by dhcp is removed. I can see that the entry is picked up during the boot of the image initially. The file is then overwritten removing the search directive. This seems to correspond with a reverse dns lookup being used to obtain a hostname as shown in the log section provided. Running dhclient after this restores the entry in resolv.conf.

In monitorng resolv.conf, I found that /etc/resolv.conf is populated with the following information initially during the pxe boot, which is the result that is needed:

search provision.example.com
nameserver 10.1.0.2

---------------------------

It is then modified to the following:

nameserver 10.1.0.2

------------------------
Apr 5 14:03:33 netcfg[2088]: DEBUG: No RA received; attempting IPv4 autoconfig
Apr 5 14:03:33 netcfg[2088]: WARNING **: Started DHCP client; PID is 2147
Apr 5 14:03:34 dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 1
Apr 5 14:03:34 dhclient: DHCPREQUEST of 10.1.0.112 on eth0 to 255.255.255.255 port 67
Apr 5 14:03:34 dhclient: DHCPOFFER of 10.1.0.112 from 10.1.0.2
Apr 5 14:03:34 dhclient: DHCPACK of 10.1.0.112 from 10.1.0.2
Apr 5 14:03:34 dhclient: bound to 10.1.0.112 -- renewal in 7192 seconds.
Apr 5 14:03:36 kernel: [ 21.621493] eth0: no IPv6 routers present
Apr 5 14:03:36 netcfg[2088]: DEBUG: Reading domain name returned via DHCP
Apr 5 14:03:36 netcfg[2088]: DEBUG: DHCP domain name is '**************'
Apr 5 14:03:36 netcfg[2088]: DEBUG: Reading NTP servers from DHCP info
Apr 5 14:03:36 netcfg[2088]: DEBUG: Read NTP server 10.1.0.2
Apr 5 14:03:36 netcfg[2088]: DEBUG: Reading nameservers from /etc/resolv.conf
Apr 5 14:03:36 netcfg[2088]: DEBUG: Read nameserver 10.1.0.2
Apr 5 14:03:36 netcfg[2088]: DEBUG: State is now 1
Apr 5 14:03:36 netcfg[2088]: DEBUG: State is now 2
Apr 5 14:03:36 netcfg[2088]: DEBUG: State is now 5
Apr 5 14:03:36 netcfg[2088]: DEBUG: Using DNS to try and obtain default hostname
Apr 5 14:03:36 netcfg[2088]: DEBUG: Getting default hostname from rDNS lookup of autoconfigured address 10.1.0.112
Apr 5 14:03:36 netcfg[2088]: DEBUG: getnameinfo() returned -3: errno 0 (Success)
Apr 5 14:03:36 netcfg[2088]: DEBUG: Getting default hostname from rDNS lookup of autoconfigured address fe80::250:56ff:feb8:5e
Apr 5 14:03:36 netcfg[2088]: DEBUG: getnameinfo() returned -2: errno 0 (Success)

-------------------

pxelinux.cfg entry:

LABEL default
  MENU DEFAULT
  MENU LABEL Ubuntu 12.04 (64-bit) Installer
  IPAPPEND 2
  KERNEL ubuntu/12.04/amd64/linux
  APPEND interface=auto lang=en_US locale=en_US console-setup/layoutcode=us priority=critical debian-installer/allow_unauthenticated=true initrd=ubuntu/12.04/amd64/initrd.gz url=http://kickstart/cgi-bin/example.cgi ramdisk_size=10882 root=/dev/ram0 devfs=mount,dall rw --

Tags: precise
Revision history for this message
Mac Welch (learn2mac) wrote :
tags: added: precise
Jorge Castro (jorge)
Changed in netcfg (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Could this be also a bug in resolvconf package? and/or resolvconf & netcfg?

(resolvconf used/installed by default now)

Revision history for this message
Stéphane Graber (stgraber) wrote :

no, that's a netcfg bug.
resolvconf doesn't run in d-i, only on the target system.

Revision history for this message
alexg (asg1290) wrote :

I believe this is related to this bug

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682342

There is a patch in that report that fixes the issue

Nish Aravamudan (nacc)
Changed in netcfg (Ubuntu Bionic):
status: New → Confirmed
Nish Aravamudan (nacc)
description: updated
Changed in netcfg (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.