Ubuntu 14.04.2 LTS Configuration DNS Server

Source: Internet
Author: User
Tags system log nameserver nslookup

   我们目的是用一台局域网机器完成 192.168.1.113 <-->cloudshield.com的解析,指定A记录和CNAME;

0. About Ubuntu download, install, update here to skip directly;

1. Download the installation tool BIND9
sudo apt-get install bind9

The DNS configuration file is in the/etc/bind directory. After installing BIND9, the following three configuration files are generated:
named.conf;
Named.conf.options;
named.conf.local; Named.conf is the main configuration file, which contains the named.conf.options and named.conf.local, we set up the local DNS, only need to change the named.conf.local;

2. Modify the/etc/bind/named.conf.local file, mainly add two zones: Forward parsing and reverse parsing ( 这里直接附上我自己的配置,由于编辑器会去除文件中的tab变成空格,所以就不贴配置文件引起误解了,最后会放在附件里,如果有需要的可以下载 )

3. Create the db.cloudshield.com file and configure it (depending on the path of the named.conf.local)
sudo touch /var/cache/bind/db.cloudshield.com
And then sudo vi open the following editor.

It's important to note that in addition to root.cloudshield.com, the middle space is tab.

4. Create the db.1.168.192 file and edit it as follows (this is because DNS parsing is right-to-left so write it backwards, and it's an IP segment, which is similar, no more)

5. In/etc/bind/named.conf.option, do some file log location pointing

6. Set the machine for the first DNS nameserver, in the/etc/resolv.conf file (note: I am in the modification of this is a link file, so directly to the past to modify the source file on the line)

Add in the first line: nameserver 192.268.1.113

Here the entire DNS configuration is complete;

7. Test it:

记得首先的重启下bind9
Shell Knockservice bind9 restart

This time can be measured with tools such as host/dig/nslookup (usually comes with):

Host

Dig

Nslookup

8. If unable to test pass or restart bind, it is likely because the configuration file format is not correct, you can use the tail name to view the system log, gradually find the problem, I believe that the method is more difficult;

tail -10 /var/log/syslog

Simultaneous release in personal forum: [http://itpark.sinaapp.com/thread-index-fid-4-tid-293.htm]
There are many shortcomings in the article, please correct me if there are errors;

Ubuntu 14.04.2 LTS Configure DNS server

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.