NVETHIS
07-14-2003, 05:25 PM
I'm running RH 9 and have a question about my hostname. It's currently being set by my cable provider because I have eth0 connected to the cable modem and set to dhcp. Well, I want my hostname to be computerxpress.d2g.com and it's kuda.spotsy.va.us.blablabla set by the cable company. I saw a script in /sbin called dhclient-script which contains:
#!/bin/bash
# Network Interface Configuration System
# Parts Copyright (c) 2002 Red Hat, Inc. all rights reserved.
#
# Based on:
# dhclient-script for Linux. Dan Halbert, March, 1997.
# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
# Notes:
# 0. This script is based on the netbsd script supplied with dhcp-970306.
# 1. ifconfig down apparently deletes all relevant routes and flushes
# the arp cache, so this doesn't need to be done explicitly.
# 2. The alias address handling here has not been tested AT ALL.
# I'm just going by the doc of modern Linux ip aliasing, which uses
# notations like eth0:0, eth0:1, for each alias.
# 3. I have to calculate the network address, and calculate the broadcast
# address if it is not supplied. This might be much more easily done
# by the dhclient C code, and passed on.
function make_resolv_conf() {
if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
echo '; generated by /sbin/dhclient-script' > /etc/resolv.conf
if [ -n "$new_domain_name" ]; then
echo search $new_domain_name >> /etc/resolv.conf
fi
for nameserver in $new_domain_name_servers; do
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
}
That's not all of it, but the first part, which seems to be setting my /etc/resolv.conf automatically, even when I change it myself to use the search computerxpress.d2g.com and nameserver 10.10.10254 (which is my DNS). Can someone help me fix this problem.
I want the hostname to be computerxpress.d2g.com and the /etc/resolv.conf to use my DNS (computerxpress.d2g.com, 10.10.10254) as the DNS. Thanks.
#!/bin/bash
# Network Interface Configuration System
# Parts Copyright (c) 2002 Red Hat, Inc. all rights reserved.
#
# Based on:
# dhclient-script for Linux. Dan Halbert, March, 1997.
# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
# Notes:
# 0. This script is based on the netbsd script supplied with dhcp-970306.
# 1. ifconfig down apparently deletes all relevant routes and flushes
# the arp cache, so this doesn't need to be done explicitly.
# 2. The alias address handling here has not been tested AT ALL.
# I'm just going by the doc of modern Linux ip aliasing, which uses
# notations like eth0:0, eth0:1, for each alias.
# 3. I have to calculate the network address, and calculate the broadcast
# address if it is not supplied. This might be much more easily done
# by the dhclient C code, and passed on.
function make_resolv_conf() {
if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
echo '; generated by /sbin/dhclient-script' > /etc/resolv.conf
if [ -n "$new_domain_name" ]; then
echo search $new_domain_name >> /etc/resolv.conf
fi
for nameserver in $new_domain_name_servers; do
echo nameserver $nameserver >>/etc/resolv.conf
done
fi
}
That's not all of it, but the first part, which seems to be setting my /etc/resolv.conf automatically, even when I change it myself to use the search computerxpress.d2g.com and nameserver 10.10.10254 (which is my DNS). Can someone help me fix this problem.
I want the hostname to be computerxpress.d2g.com and the /etc/resolv.conf to use my DNS (computerxpress.d2g.com, 10.10.10254) as the DNS. Thanks.