aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/rc.sysinit8
-rw-r--r--sysconfig/network-scripts/network-functions4
2 files changed, 4 insertions, 8 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 955d271d..b89730db 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -25,10 +25,6 @@ swapon -a
hostname ${HOSTNAME}
echo hostname: `hostname`
-if [ -n ${DOMAIN} ]; then
- DOMAIN=`echo $HOSTNAME | sed 's/^[^\.]*\.//'`
-fi
-
# Set the NIS domain name
if [ -n "$NISDOMAIN" ]; then
domainname $NISDOMAIN
@@ -161,10 +157,6 @@ if [ -x /sbin/kerneld -a -n "$USEMODULES" ]; then
KERNELD=yes
fi
-if ! grep search /etc/resolv.conf ; then
- echo "search $DOMAIN" >> /etc/resolv.conf
-fi
-
# Check filesystems
if [ ! -f /fastboot ]; then
echo "Checking filesystems."
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 9b108bb7..db1d9f8c 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -43,4 +43,8 @@ set_hostname()
{
echo "$1" > /etc/HOSTNAME
hostname $1
+ if ! grep search /etc/resolv.conf; then
+ domain=`echo $1 | sed 's/^[^\.]*\.//'`
+ echo "search $domain" >> /etc/resolv.conf
+ fi
}