个人工具

DNS

来自Ubuntu中文

Qiii2006讨论 | 贡献2010年8月1日 (日) 12:08的版本 (以内容'==DNS解析== <pre>root@ubuntu:~# cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 domain domain search domain </pre> <pre> 8.8.8.8 8.8.4.4</pre> 这是 Google …'创建新页面)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

DNS解析

root@ubuntu:~# cat /etc/resolv.conf
nameserver 8.8.8.8 
nameserver 8.8.4.4
domain domain
search domain
8.8.8.8
8.8.4.4

这是 Google 公共 DNS。

hosts

root@ubuntu:~# cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       ubuntu.ubuntu-domain    ubuntu

192.168.0.251 web1.example.com web1

192.168.0.252 web2.example.com web2

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

用于本地解析域名,比前面那个优先级更高。

dhclient

通过DHCP获取IP

sudo dhclient 网卡名

同时会根据DHCP服务器的设定修改resolv.conf中的nameserver字段。

锁定resolv.conf中的域名解析服务器地址