配置DNS、搜索域和主机名

一、配置DNS和搜索域

专门配置DNS的文件为/etc/resolv.conf;同时我们也可以在ifcfg-eth0等网卡配置的配置文件中指定。

示例:

[root@instructor Desktop]# cat /etc/resolv.conf
search example.com
nameserver 192.168.0.254
[root@instructor Desktop]# 

二、配置主机名


[root@instructor Desktop]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=instructor.example.com
NISDOMAIN=notexample
[root@instructor Desktop]# 

三、配置主机记录

[root@instructor Desktop]# cat /etc/hosts
127.0.0.1         localhost localhost.localdomain
::1               localhost6 localhost6.localdomain6
192.168.0.254     instructor.example.com  instructor i
[root@instructor Desktop]# 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章