resolv.conf is being modified,
2009-05-13 13:18:14来源:未知 阅读 ()
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
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- Freebsd oracle 10g 2009-05-13
- KDE/FreeBSD 测试 QT-4.5.1. 2009-05-13
- OpenBSD 4.5下安装Gnome 2.24成功! 2009-05-13
- OpenBSD 4.5 2009-05-13
- DragonFly BSD 2.2.1发布 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash