Ubuntu 14.04.2 LTS configure DNS Server
Our goal is to use a lan machine to complete the resolution of 192.168.1.113 <--> cloudshield.com, specifying A record and CNAME;
0. For Ubuntu 14.04.2 LTS download, installation, and update, skip this step;
1. Download the Installation Tool bind9
sudo apt-get install bind9
The DNS configuration file is in the/etc/bind directory. After bind9 is installed, the following three configuration files are 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 the named when setting up the local dns. conf. local;
2. Modify the/etc/bind/named. conf. local file to add two zones: forward resolution and reverse resolution (I directly attached my own configuration here. Because the editor will remove the tab in the file and turn it into a space, it will not post the configuration file, causing misunderstanding. It will be placed in the attachment. If necessary, you can download it.
)
3. Create and configure the db.cloudshield.com file (the specific file location is determined by the named. conf. local path)
sudo touch /var/cache/bind/db.cloudshield.com
Thensudo vi
Click Edit below.
Note that besides root.cloudshield.com, the leading and trailing spaces in the file are tabs.
4. create the db.1.168.192 file and edit it as follows (this is because DNS resolution is from right to left, so it is written backwards, and it is an ip segment. The specific method is similar to the above and will not be repeated)
5. in/etc/bind/named. conf. option, point
6. Set the local host to the first DNS nameserver in the/etc/resolv. conf file (Note: This is a link file when I modify it, so you can directly modify the source file)
Add to the first line:nameserver 192.268.1.113
The entire DNS configuration is complete;
7. Test it:
Remember to restart bind9 first
Shell knockservice bind9 restart
In this case, you can use host, dig, nslookup, and other tools (usually included) to test:
Host:
Dig:
Nslookup:
8. If the bind cannot be tested or restarted, it is probably because the configuration file format is incorrect. You can use the tail name to view the system logs and find problems gradually. I believe the solution is always more difficult;
tail -10 /var/log/syslog
Six things to be done after Ubuntu 14.10 is installed
Ubuntu 14.10 text tutorial on hard drive installation in Windows 7