ubuntu如何配置域名服务器地址
ubuntu配置域名服务器地址的方法:1.打开终端输入以下命令进行安装配置DNS。
sudo apt install bind9
2.修改配置文件“/etc/bind/named.conf.local”,添加正逆解析文件的配置,修改后如下:
//// Do any local configuration here//// Consider adding the 1918 zones here, if they are not used in your// organization//include "/etc/bind/zones.rfc1918";//domain->ipzone "flovem.home" in {type master;file "/var/cache/bind/db.flovem.home";};//ip->domainzone "0.168.192.in-addr.arpa" in {type master;file "/var/cache/bind/reverse/db.0.168.192";};
3.根据第2步中的配置,添加相应的正逆向解析文件,例如:
在/var/cache/bind/目录下添加文件db.flovem.home:
//正向解析$TTL 604800@ IN SOA flovem.home. root.flovem.home. (2 ; Serial604800 ; Refresh86400 ; Retry2419200 ; Expire604000) ; Negative Cache TTL;; name servers@ IN NS ns.flovem.home.@ IN A 192.168.0.102;ns recordsns IN A 192.168.0.102;host recordshangzhou IN A 192.168.0.102
在/var/cache/bind/reverse/目录中添加文件db.0.168.192
//逆向解析$TTL 604800@ IN SOA flovem.home. root.flovem.home. (2 ; Serial Number604800 ; Refresh86400 ; Retry2419200 ; Expire86400 ); ; Minimum@ IN NS flovem.home.66 IN PTR hangzhou.flovem.home.
4.重启ubuntu使其生效即可。
页:
[1]