FreeBSD DJBDNS:Tinydns添加其他域名

时间:2020-01-09 10:38:31  来源:igfitidea点击:

如何在现有的tinydns服务器ns1.theitroad.com和ns2.theitroad.com中添加其他域名,例如theitroad.com和theitroad.com?

您可以如下将其他域添加到同一数据配置文件中。

打开/var/ns1.theitroad.com/root/data文件,执行:

# vi /var/ns1.theitroad.com/root/data

如下追加theitroad.com和theitroad.com:

##########################
# theitroad.com zone
##########################
.theitroad.com::ns1.theitroad.com
.theitroad.com::ns2.theitroad.com
#define mx for theitroad.com
@theitroad.com::mail01.theitroad.com:10
@theitroad.com::mail02.theitroad.com:20
#define A and www for cybercit.com
+theitroad.com:10.16.48.99
+www.theitroad.com:10.16.48.99

##########################
# theitroad zone
##########################
.theitroad.com::ns1.theitroad.com
.theitroad.com::ns2.theitroad.com
#define mx for theitroad.com
@theitroad.com::mail01.theitroad.com:10
@theitroad.com::mail02.theitroad.com:20
#define A and www for cybercit.com
+theitroad.com:75.126.168.152
+theitroad.com:75.126.168.152

保存并关闭文件。

cd到/var/ns1.theitroad.com/root并运行make。
这将编译tinydns读取的data.cdb:

# cd /var/ns1.theitroad.com/root
# make

再次使用主机或其他工具测试新添加的域:

# host www.theitroad.com

或者

# dnsip theitroad.com