In ubuntu, use bind9 to configure dns-Linux Enterprise Application-Linux server application information. For more information, see. This article only summarizes my dns setup process and does not explain the principles of dns.
1. Install bind9
Sudo apt-get install bind
2. bind9 Configuration File explanation
After bind9 is installed, the following configuration file is generated: named. conf/named. conf. options/named. conf. local, where named. conf is the main configuration file, which contains named. conf. options and named. conf. local, we only need to change named when setting up dns. conf. local.
3. Set the instance
(1) Environment: Host A: Host Name: jzzlx, ip: 10.9.110/24; host B: Host Name ubuntu, ip: 10.9.1.79/24
Host B is now set up as the primary dns server, which requires resolution
Ubuntu. jh9z. com 10.9.1.79
Www. jh9z. com 10.9.1.79
Jzzlx. jh9z. com 10.9.1.110
(2) Analysis: Based on the host name and ip address, we can see that,
① Add the forward region "jh9z.com" and the reverse region "1.9.10.in-addr. arpa ",
② In the "jh9z.com" area, add the record ubuntu to correspond to 79, jzzlx to correspond to 110, and CNAME record www to correspond to ubuntu
③ Add ubuntu 110 and jzzlx in the "1.9.10.in-addr. arpa" Area
(3) edit the configuration file
① Edit named. conf. local
Add the following statements
// Reverse Region
Zone "1.9.10.in-addr. arpa "{
Type master;
File "/etc/bind/db.10.9.1 ";
};
// Forward Region
Zone "jh9z.com "{
Type master;
File "/etc/bind/db.jh9z.com ";
};
② Create the db.10.9.1 file under/etc/bind
; Db.10.9.1
;
$ TTL 604800
@ In soa ubuntu.jh9z.com. root. ubuntu. jh9z. com .(
1; Serial
604800; Refresh
86400; Retry
2419200; Expire
604800); Negative Cache TTL;
@ In ns ubuntu. jh9z. com.
79 in ptr ubuntu. jh9z. com.
110 in ptr jzzlx. jh9z. com.
③ Create a db.jh9z.com file under/etc/bind
; Db.jh9z.com
;
$ TTL 604800
@ In soa ubuntu.jh9z.com. root. ubuntu. jh9z. com .(
1; Serial
604800; Refresh
86400; Retry
2419200; Expire
604800); Negative Cache TTL;
@ In ns ubuntu. jh9z. com.
Ubuntu in a 10.9.1.79
Www in cname ubuntu
Jzzlx in a 10.9.1.110
(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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service