Chinaunix首页 | 论坛 | 博客
  • 博客访问: 65521
  • 博文数量: 20
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 185
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 11:15
文章分类
文章存档

2009年(4)

2008年(16)

我的朋友

分类: LINUX

2008-10-20 18:31:33

In Ubuntu if DHCP is enabled, DHCP server will also supply a DNS server and gateway.
In some circumstances, you may want use a static DNS.
Question is: how to enable DHCP with static DNS servers?


Edit /etc/dhcp3/dhclient.conf

Add or replace a line

prepend domain-name-servers your.name.server.ipaddr;


where your.name.server.ipaddr is replaced by your desired name server. You can list multiple servers in sequence by using a comma-separated list. Don't forget the semi-colon at the end of the line.

This tells dhclient to prepend these servers to whatever list it gets from the DHCP service when writing the /etc/resolv.conf. You'll see them (listed before the others) in the /etc/resolv.conf after DHCP completes. Normal resolution semantics then apply to this list, namely these servers will be used first; if they fail to respond, the client will proceed to following ones, but subsequent servers are not used if any returns an actual result, even if it is NXDOMAIN (i.e. not found).

You can entirely supersede the servers provided by the DHCP service using

supersede domain-name-servers your.name.server.ipaddr;


You can also edit the 'request' line and select what information you want to get from DHCP.
阅读(1096) | 评论(0) | 转发(0) |
0

上一篇:Linux下增加swap space

下一篇:查看Linux版本

给主人留下些什么吧!~~