[PLUG] /etc/resolv.conf and DHCP

Steven Raymond stever at woo-hoo.com
Thu Aug 21 15:41:01 UTC 2003


Sounds great, but it doesn't work for some reason.  Can you see what I'm
doing wrong?

[root at spectre network-scripts]# pwd
/etc/sysconfig/network-scripts
[root at spectre network-scripts]# ll ifcfg*
-rw-r--r--    1 root     root           50 Aug 21 15:33 ifcfg-eth0
lrwxrwxrwx    1 root     root           22 Apr  1 22:12 ifcfg-lo ->
../networking/ifcfg-lo
[root at spectre network-scripts]# more ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
PEERDNS=no

[root at spectre network-scripts]# /etc/init.d/network stop
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
[root at spectre network-scripts]# vi /etc/resolv.conf
[root at spectre network-scripts]# more /etc/resolv.conf
search woo-hoo.com eli.net
nameserver 209.210.31.3
nameserver 207.173.7.227
nameserver 209.63.0.2
[root at spectre network-scripts]# /etc/init.d/network start
Setting network parameters:                                [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
[root at spectre network-scripts]# more /etc/resolv.conf
; generated by /sbin/dhclient-script
search woo-hoo.com
nameserver 209.210.31.3
nameserver 207.173.7.227
nameserver 209.63.0.2
[root at spectre network-scripts]#
[root at spectre network-scripts]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:E0:18:F1:4A:E7
          inet addr:209.210.31.8  Bcast:209.210.31.31  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22833 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11296 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:5368208 (5.1 Mb)  TX bytes:1959798 (1.8 Mb)
          Interrupt:10 Base address:0xc000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:135700 errors:0 dropped:0 overruns:0 frame:0
          TX packets:135700 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10249855 (9.7 Mb)  TX bytes:10249855 (9.7 Mb)

[root at spectre network-scripts]#


Thanks!




> Edit /etc/sysconfig/network-scripts/ifcfg-eth0 (replacing 'eth0' with
> the actual name of your ethernet interface) and add a single line:
>
> PEERDNS=no
>
> The full and gory details can be found in /sbin/ifup; the relevant
> section reads,
>
>     if [ "${PEERDNS}" = "no" ]; then
>        # Do not update/replace resolv.conf.
>        PUMPARGS="${PUMPARGS} -d"
>        DHCPCDARGS="${DHCPCDARGS} -R"
>     fi
>
> Once you've updated the ifcfg file, and assuming you're working at the
> machine's console (i.e., not over the network), then
>
> 1. /etc/init.d/network stop
>
> 2. Edit /etc/resolv.conf to fit your needs
>
> 3. /etc/init.d/network start








More information about the PLUG mailing list