Bug 144324

Summary: No hostname in dhc/DNS setup
Product: [openSUSE] SUSE Linux 10.1 Reporter: Michael Calmer <mc>
Component: NetworkAssignee: Robert Love <rml>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None    
Version: Beta 2   
Target Milestone: Beta 3   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: hostname via dns patch
same patch, new style

Description Michael Calmer 2006-01-20 11:35:29 UTC
I did an standard installation of SL10.1
I changed /etc/sysconfig/network/config NETWORKMANAGER=yes
and restart the network

I got an IP address on eth0 and I have a working DNS setup

$> nslookup <my_ip>
client.ay.test

Now I have this:

$> hostname
linux
$> hostname -d 
unknown host: ....

In /etc/HOSTNAME was the entry "linux.site"

/etc/hosts looks like this:

#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
Comment 1 Robert Love 2006-01-20 15:15:31 UTC

*** This bug has been marked as a duplicate of 116466 ***
Comment 2 Christian Zoz 2006-01-20 15:31:20 UTC
This is not a duplicate of bug 116466.
This bug is about setting hostname at all.
bug 116466 is about reloading syslog after hostname was changed.

I'm just working on all that.
Comment 3 Robert Love 2006-01-23 21:29:34 UTC
Submitted NM today that respects DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp.
Comment 4 Timo Hoenig 2006-01-26 09:15:50 UTC
With Beta2 we properly set the hostname if

* DHCLIENT_SET_HOSTNAME is yes
* DHCP server supplied a hostname

We do not yet set the hostname if

* DHCLIENT_SET_HOSTNAME is yes
* DHCP server did _not_ supply a hostname

This is still required, Stefan just told me that he has prepared a patch.  Looking forward to seeing this working aswell.

Stefan, can you please take care?  Please pass the patch to Robert and me sometime soon.  I'd love to see this working in Beta3.

Moving to Beta2.
Comment 5 Stefan Scheler 2006-01-26 09:29:32 UTC
Here's the patch. It works finde on my machine.

Timo, Robert, please review.
Comment 6 Stefan Scheler 2006-01-26 09:30:08 UTC
Created attachment 65118 [details]
hostname via dns patch
Comment 7 Timo Hoenig 2006-01-26 19:27:10 UTC
Thanks, Stefan.  Patch looks good to me.  Will give it a try tomorrow.
Comment 8 Timo Hoenig 2006-01-27 11:54:32 UTC
Doesn't only look good, it also works like a charm.

I'll attach the patch with some coding style fixes; no functional changes.

Robert, if agree with the patch, can you please take care to get this into NM CVS and Beta3?

Thanks!
Comment 9 Timo Hoenig 2006-01-27 11:55:39 UTC
Created attachment 65380 [details]
same patch, new style
Comment 10 Robert Love 2006-01-27 15:42:10 UTC
Checked into CVS and submitted to autobuild.