install and config bind9(named) on linux server

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.gz
https://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 installed
named -v
named -g 

## generate rndc.key
cd /etc
rndc-confgen -a

## generate /etc/named.conf with contents 
cat /etc/named.conf
zone "lingcloud.com" {
type master;
file "/etc/bind/zones/lingcloud.com.db";
};

## config zone with example contents
cat /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 cutover
ts parent domain.
@ IN SOA ns1.lingcloud.com. host.lingcloud.com. (
201006601 ; Serial
7200 ; Refresh
120 ; Retry
2419200 ; Expire
604800) ; Default TTL
;
; NS record indicate which name server are authoritative for the zone/domain. It is primarily used if you w
lingcloud.com. IN NS ns1.lingcloud.com.
;A record
lingcloud.com. IN A 10.41.104.171
; ns seems to be name server's ip
ns1 IN A 10.41.104.232

nodeB IN A 10.41.104.171
nodeB.realmB IN A 10.41.104.171
nodeC IN A 10.41.104.171
nodeC.realmC IN A 10.41.104.171

;NAPTR record
realmB 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.1
Default server: 127.0.0.1
Address: 127.0.0.1#53
> lingcloud.com
Server:		127.0.0.1
Address:	127.0.0.1#53

Name:	lingcloud.com
Address: 10.41.104.172
> nodeB.lingcloud.com
Server:		127.0.0.1
Address:	127.0.0.1#53

Name:	nodeB.lingcloud.com
Address: 10.41.104.171
> set type=NAPTR
> realm1.lingcloud.com     
Server:		127.0.0.1
Address:	127.0.0.1#53

realm1.lingcloud.com	naptr = 50 100 "s" "aaa:diameter.tcp" "" _diameter._tcp.srv1.lingcloud.com.
> set type=SRV
> _diameter._tcp.srv1
Server:		127.0.0.1
Address:	127.0.0.1#53

_diameter._tcp.srv1.lingcloud.com	service = 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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值