resolv.conf is being modified,

2009-05-13 13:18:14来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


This problem occurred because DHCP overwrites the contents of resolv.conf. and I didn't know that.  But you have quite a bit of control over what DHCP puts into that file.   Details are below.
29 July 1998
After my reboot as a result of my
floppy disk mount exploits
, I found that the contents of resolv.conf had been modified.
What is dhcp?
DHCP (Dynamic Host Configuration Protocol ) is defined in RFCs 2131 and 2132 and provides a client with a complete set of TCP/IP configuration values.  In short, it allows a client to obtain, among other things, an IP number, the name of the domain, and a list of name servers.
I recommend you read the following book: TCP/IP Network Administration by Craig Hunt and published by O'Reilly,   ISBN 1-56592-322-7.  This book is also known as the crab book (you'll know why when you see the cover).
The problem
As mentioned above, I noticed a minor but very irritating problem.  Whenever the name was rebooted, the contents of resolv.conf would change and manual modification was needed in order for the system to resolve names again.
What appeared after a reboot:
search myisp.com
nameserver 11.22.33.44
nameserver 11.22.33.45
What I wanted:
domain www.example.org
nameserver 10.0.0.1        # my min-dns server
nameserver 11.22.33.44
nameserver 11.22.33.45
31 July 1998
It turns out that DHCP client will rewrite the contents of resolv.conf with the information it obtains from the DHCP server.  Well, that's not good enough.
Here's what resolv.conf contains after a reboot:
search myisp.com
nameserver 11.22.33.44
nameserver 11.22.33.45
Here's what I want it to contain:
domain www.example.org
nameserver 10.0.0.10                # my min-dns server
nameserver 11.22.33.44
nameserver 11.22.33.45
I'll report back after I get this solved.  The reason I want the above is related to
my name server
.
1 August 1998
White rabbits.
The message from the mailing list mentions the prepend command and to check out man dhclient.conf.  What I find there is I need to do something like:
prepend {
domain-name "www.example.org";
domain-name-servers 10.0.1.4;
}
I tried that.  Then did the following to restart dhclient:
bash# cat /var/run/dhclient.pid
5676
bash# kill -9 5676
bash# dhclient ed0
The prepend command I used gave syntax errors.  And my ed1 link died.  So I issued:
ifconfig ed1 inet 10.0.0.1 255.255.255.0
After several attempts. No luck.
prepend domain-name "www.example.org";
Neah.  Still doesn't work.
Checking the documentation....
The example provided by man dhclient.conf shows the prepend statement within the interface "ep0" {...} statement.  I found this didn't work for me and no effect on the contents of /etc/resolv.conf.  My next attempt involved moving the prepend command to be above the interface command.

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:mounting fd0 without a floppy gives a GPF

下一篇:Time synchronization - xntpd