Primary DNS
Requirements
- IP:
192.168.1.1/24, DNS points to itself - Forward/reverse zones for
infanx.com
| Host | Type | Value |
|---|---|---|
| ns1 | A | 192.168.1.1 |
| ns2 | A | 192.168.1.2 |
| www | A | 192.168.1.100 |
| bbs | CNAME | www |
| ftp | A | 192.168.1.110 |
| MX 10 | 192.168.1.120 |
Configuration
setenforce 0 && systemctl stop firewalld
# NIC: BOOTPROTO=static, IPADDR=192.168.1.1, NETMASK=255.255.255.0, DNS1=192.168.1.1
yum install -y bind* vim*
Edit /etc/named.conf — set dnssec-enable no; dnssec-validation no;
Edit zone file /etc/named.rfc1912.zones:
zone "1.168.192.in-addr.arpa" { type master; file "infanx.com.loopback"; };
zone "infanx.com" { type master; file "infanx.com.empty"; };
Copy templates: cp -p named.localhost infanx.com.empty && cp -p named.loopback infanx.com.loopback
Forward file (infanx.com.empty): NS/A/CNAME/MX records as per requirements.
Reverse file (infanx.com.loopback): PTR records for each IP.
systemctl restart named
nslookup # verify all records resolve correctly
Caching DNS (Forwarder)
Install DNS, edit /etc/named.conf:
forwarders { 192.168.1.1; };
forward first;
Or configure per-zone forwarding in named.rfc1912.zones.
Secondary DNS (DNS Cluster)
Add NS/A records for secondary DNS in primary zone files.
On secondary: type slave; file "slaves/..."; masters { 192.168.1.1; };
Remember to increment SOA serial on primary when updating zones.
Sub-DNS (Subdomain Delegation)
Parent adds NS record pointing to child DNS: frp IN NS ns1.frp / ns1.frp IN A 192.168.1.200
Child creates zone frp.infanx.com with its own records.