Ubuntu 14.04.2 LTS configuration DN Sserver

Source: Internet
Author: User
Tags nameserver nslookup

Ubuntu 14.04.2 LTS configuration DN Sserver

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. Skip downloading, installing, and updating ubuntu;

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/etc/bind/named. conf. the local file is mainly used 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, therefore, the configuration file will not be pasted, causing misunderstanding. It will be stored in the attachment and can be downloaded if necessary)

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
Then edit sudo vi as follows.

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 knock service 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

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.