frefrefre
erfewfe
cname配置
cname 记录
1、先ping imooc的ip
ping www.imooc.com-->117.121.101.40
2、修改/var/named/imooc.com.zone文件,将www的A记录IP地址替换成imooc的IP地址
$TTL 7200
imooc.com. IN SOA imooc.com. ho.imooc.com. (222 1H 15M 1W 1D)
imooc.com. IN NS dns1.imooc.com.
dns1.imooc.com. IN A 192.168.199.202
www.imooc.com. IN A 117.121.101.41
3、修改/etc/named.conf文件,添加zone "iaskjob.com"
options{
directory "/var/named";
};
zone "imooc.com"{
type master;
file "imooc.com.zone";
};
zone "iaskjob.com"{
type master;
file "iaskjob.com.zone";
};
4、新建iaskjob.com.zone文件并编辑
vim /var/named/iaskjob.com.zone
$TTL 7200
iaskjob.com. IN SOA isakjob.com.
iaskjob.163.com. (4012100 1H 15M 1W 1D)
iaskjob.com. IN NS dns1.iaskjob.com.
dns1.iaskjob.com. IN A 192.168.199.202
imooc.iaskjob.com. IN CNAME www.imooc.com.
service named restart
6、本机测试 dig @127.0.0.1 imooc.iaskjob.com
7、远程测试
物理机设置DNS为虚拟机的IP(192.168.199.202)
物理机运行nslookup imooc.iaskjob.com
能解析到imooc的IP地址就表示正确
补充:重启服务如有报错查看/var/log/messages
tail -f /var/log/messages