Operating System: ubuntu1204 Server Edition
DNS software: bind9
Newoa.qyjob.net points to the 168.168.168.96 IP Address
Run the following command to install
Sudo apt-Get install bind9 dnsutils bind9-doc
By default. Bind9 is configured as a DNS Cache Server. Therefore, you only need to add the DNS server address to the forwarding list.
Sudo Vim/etc/bind/naemd. conf. Options
Red is to be modified
[Plain]View plaincopy
- Options {
- Directory "/var/Cache/bind ";
- // If there is a firewall between you and nameservers you want
- // To talk to, you may need to fix the firewall to allow multiple
- // Ports to talk. See http://www.kb.cert.org/vuls/id/800113
- // If your ISP provided one or more IP addresses for stable
- // Nameservers, you probably want to use them as forwarders.
- // Uncomment the following block, and insert the addresses replacing
- // The All-0's placeholder.
- Forwarders {
- 210.21.4.130;
- };
- // ================================================ ========================================
- // If bind logs error messages about the root key being expired,
- // You will need to update your keys. See https://www.isc.org/bind-keys
- // ================================================ ========================================
- DNSSEC-validation Auto;
- Auth-nxdomain no; # conform to rfc1035
- Listen-on-v6 {Any ;};
- };
Configure the primary DNS Server
Create forward zone File
Sudo Vim/etc/bind/named. conf. Local
Add the following content
[Plain]View plaincopy
- Zone "qyjob.net "{
- Type master;
- File "db.qyjob.net ";
- };
Sudo CP/etc/bind/DB. Local/var/Cache/bind/db.qyjob.net
Sudo Vim/var/Cache/bind/db.qyjob.net[Plain]View plaincopy
- $ TTL 604800
- @ In SOA qyjob.net. root.qyjob.net .(
- 2; Serial
- 604800; refresh
- 86400; retry
- 2419200; expire
- 604800); negative cache TTL
- ;
- @ In NS localhost.
- @ In a 127.0.0.1
- Newoa in a 168.168.168.96
- @ In AAAA: 1
Sudo/etc/init. d/bind9 restart and test it to find that newoa.qyjob.net is already directed to DNS.
I do not want to perform reverse DNS for the time being. I want to find information for myself.
Http://blog.csdn.net/emtit2008/article/details/7854894
Step 1: Enable DNS caching and forwarding: edit/etc/bind/named. conf. option file, enable forwarders, and enter the correct upstream DNS server, that is, the server that the ISP gives in the format:
Forwarders {202.96.128.86 ;};
I. Bind main files
/Etc/bind/named. conf
/Etc/bind/named. conf. Local 2. instance {Host (a) ip192.168.1.122/24 www.hp6515b.com | host (B) ip192.168.1.193/24}
① Edit named. conf. Local
Add the following statements
// Reverse Region
Zone "1.168.192.in-ADDR. Arpa "{
Type master;
File "/etc/bind/db.192.168.1 ″;
};
// Forward Region
Zone "hp6515b.com "{
Type master;
File "/etc/bind/db.hp6515b.com ";
};
② Create the db.192.168.1 file under/etc/Bind
; Db.192.168.1
;
$ TTL 604800
@ In SOA www.hp6515b.com. root.hp6515b.com .(
1; Serial
604800; refresh
86400; retry
2419200; expire
604800); negative cache TTL
;
@ In NS www.hp6515b.com.
122 in PTR bbs.hp6515b.com.
193 in PTR xp.hp6515b.com.
③ Create the hp6515b.com file under/etc/bind; db.hp6515b.com
;
$ TTL 604800
@ In SOA www.hp6515b.com. root.hp6515b.com .(
1; Serial
604800; refresh
86400; retry
2419200; expire
604800); negative cache TTL;
@ In NS www.hp6515b.com.
WWW in a 192.168.1.122
BBS in cname WWW
Xp.hp6515b.com. In a 192.168.1.193
(4) Restart named
Sudo/etc/init. d/bind9 restart
The DNS configuration is complete at this location. You can try NSLookup.
Note: bind9 must be restarted after the configuration file is changed.
Iii. Precautions and skills
1. Ubuntu generally does not need root login to modify the file. How to create the file
Example: sudo VI/etc/bind/named. conf. Local
Create sudo VI/etc/bind/db.192.168.1
2. design the Domain Name Server under/etc/resolv. CONF/, for example, nameserver 192.168.1.122.
Http://www.chenjunhui.com/archives/34.html