Bug 10155 - ifup does not set hostname when using DHCP and hostname not already set.
ifup does not set hostname when using DHCP and hostname not already set.
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2000-03-13 17:47 EST by Greg Retkowski
Modified: 2014-03-16 22:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-03-20 11:07:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Greg Retkowski 2000-03-13 17:47:50 EST
/sbin/ifup does not automatically set the machine's hostname if the machine
is configured to use DHCP and does not have a hostname set in
/etc/sysconfig/network. Although /sbin/ifup runs the 'need_hostname' script
(sourced from network-functions) it never uses the NEEDHOSTNAME variable to
take measures to assign a hostname from DNS if none is present.

The hostname not being set results in problems including sendmail failing
to send messages by SMTP as most SMTP servers reject 'HELO (none)' apon
initiation of message transfer.

A patch to /sbin/ifup follows:

--- /tmp/ifup.orig	Mon Mar 13 22:48:31 2000
+++ /sbin/ifup	Mon Mar 13 22:48:57 2000
@@ -87,6 +87,9 @@
     if [ -n "$DHCP_HOSTNAME" ]; then
+    if [ -n "$NEEDHOSTNAME" ]; then
+       PUMPARGS="$PUMPARGS --lookup-hostname"
+    fi
     echo -n "Determining IP information for $DEVICE..."
     if /sbin/pump $PUMPARGS -i $DEVICE ; then
 	echo " done."
Comment 1 Bill Nottingham 2000-03-20 11:07:59 EST
fixed as of initscripts-5.02-1.

Note You need to log in before you can comment on or make changes to this bug.