標籤:linux dns bind network
This article shows my process of installing and configuring bind9 DNS server on a linux server. I didn‘t touch every aspects of bind9, but following the process, a DNS server is configured with A/AAAA, NAPTR and SRV resource record types. The DNS server is able to be used for testing.
## download bind-9.10.0-P1.tar.gzhttps://www.isc.org/downloads/bind/## untar the package tar xzvf bind-9.10.0-P1.tar.gz## config and install cd bind-9.10.0-P1./configure ./make ./make install ## test named is installednamed -vnamed -g ## generate rndc.keycd /etcrndc-confgen -a## generate /etc/named.conf with contents cat /etc/named.confzone "lingcloud.com" {type master;file "/etc/bind/zones/lingcloud.com.db";};## config zone with example contentscat /etc/bind/zones/lingcloud.com.db; BIND data file for lingcloud.com;$TTL 14400 ;lingcloud.com;start of authority resource record type. Every domain must have a Start of Authority record at the cutoverts parent domain.@ IN SOA ns1.lingcloud.com. host.lingcloud.com. (201006601 ; Serial7200 ; Refresh120 ; Retry2419200 ; Expire604800) ; Default TTL;; NS record indicate which name server are authoritative for the zone/domain. It is primarily used if you wlingcloud.com. IN NS ns1.lingcloud.com.;A recordlingcloud.com. IN A 10.41.104.171; ns seems to be name server's ipns1 IN A 10.41.104.232nodeB IN A 10.41.104.171nodeB.realmB IN A 10.41.104.171nodeC IN A 10.41.104.171nodeC.realmC IN A 10.41.104.171;NAPTR recordrealmB IN NAPTR 50 100 "s" "aaa:diameter.tcp" "" _diameter._tcp.srvB.realmB.lingcloud.com.realmC IN NAPTR 51 101 "s" "aaa:diameter.tcp" "" _diameter._tcp.srvC.realmC.lingcloud.com.;SRV record_diameter._tcp.srvB.realmB IN SRV 0 1 3868 nodeB.realmB.lingcloud.com._diameter._tcp.srvC.realmC IN SRV 0 1 3868 nodeC.realmC.lingcloud.com.## start named/usr/local/sbin/named## check named status rndc status## nslookup can be used to query DNS server nslookup> server 127.0.0.1Default server: 127.0.0.1Address: 127.0.0.1#53> lingcloud.comServer:127.0.0.1Address:127.0.0.1#53Name:lingcloud.comAddress: 10.41.104.172> nodeB.lingcloud.comServer:127.0.0.1Address:127.0.0.1#53Name:nodeB.lingcloud.comAddress: 10.41.104.171> set type=NAPTR> realm1.lingcloud.com Server:127.0.0.1Address:127.0.0.1#53realm1.lingcloud.comnaptr = 50 100 "s" "aaa:diameter.tcp" "" _diameter._tcp.srv1.lingcloud.com.> set type=SRV> _diameter._tcp.srv1Server:127.0.0.1Address:127.0.0.1#53_diameter._tcp.srv1.lingcloud.comservice = 0 1 3868 nodeB.lingcloud.com.
Reference:
http://www.servermom.org/how-to-install-and-setup-bind9-on-ubuntu-server/136/
https://kb.isc.org/article/AA-00768/0/Getting-started-with-BIND-how-to-build-and-run-named-with-a-basic-recursive-configuration.html
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-bind-rndc.html