The following configuration is to implement parsing test.zp.com to a different IP address
Installing the DNS server package
$ apt-get Install BIND9
Configure DNS
The path to the configuration file is below the/etc/bind path
Add a Zone
$/etc/bind# vim/etc/bind/named.conf.local
To add the following syntax, you can refer to the syntax in/etc/bind/zones.rfc1918, as follows:
Zone "zp.com" {type master; file "/etc/bind/db.zp.com";};
Modify the configuration file for db
$/etc/bind# cp db.local db.zp.com
$/etc/bind# Vim db.zp.com
;
; BIND data file for local loopback interface
;
$TTL 604800
@ in SOA zp.com. Root.localhost. (
2; Serial
604800; Refresh
86400; Retry
2419200; Expire
604800); Negative Cache TTL
;
@ in NS localhost.
@ in A 127.0.0.1
@ in AAAA:: 1
Test in A 192.168.0.11
Test in A 192.168.0.12
Test in A 192.168.0.13
Test in A 192.168.0.14
Test in A 192.168.0.15
Test in A 192.168.0.16
To modify the/etc/bind/named.conf.option configuration file, you can set the order of the given results of bind Round-robin in named.conf:
Rrset-order {order cyclic;};
Rrset-order supports three parameters: fixed, random, cyclic.
Fixed will fix multiple A records in the configuration file order
Random will give the
The cyclic will circulate to give
Restart Service
$/etc/bind#/etc/init.d/bind9 Restart
Check configuration effects
Modify the domain name resolution configuration file
$/etc/bind# vim/etc/resolv.conf
NameServer 192.168.0.***
Add the IP address of your domain name server
$ dig test.zp.com
A simpler choice DNSMASQ
Ubuntu DNS BIND9 Configuration