Ubuntu static DNS Configuration

Source: Internet
Author: User
Tags nslookup

Static DNS means that each host on the network has a fixed IP address, and the ing between hosts and IP addresses recorded by DNS is fixed.

First install bind: sudo apt-get install bind9

 

In this case, it will appear in/etc/bind (this is different from other UNIX/LINUX systems. Generally, other UNIX/LINUX systems store the configuration file by default.

In/etc/named, data files are stored in/var/named or/var/bind, while UBUNTU is stored in this directory together)

Db.0 db.255 db. root named. conf. local
Db.127 dB. Local named. conf named. conf. Options

Among them, named. conf is the main configuration file, named. conf. Local and named. conf. Options files are stored in other Unix/Linux

This is not available in the system by default. The Ubuntu idea is very good, and all parts are managed separately. The other parts are generated by default.

Data files. Here we need to explain the meanings of several resource records in the data file:

SOA record: indicates the region's authority
NS record: List A name server in the region
A record: name-to-address ing (I .e. forward resolution)
PTR record: Address-to-name ing (reverse resolution)
Cname: canonical name (alias record)

Next configuration: we only need to change the named. conf. Local file to OK. Ubuntu is not recommended to be directly configured in named. conf:

Sudo vi/etc/bind/named. conf. local

Add as follows:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// Organization
// Include "/etc/bind/zones. rfc1918 ";

Zone "15.117.202.in-addr. arpa "{
Type master;
File "/etc/bind/db.202.117.15 ";
};

Zone "test.com "{
Type master;
File "/etc/bind/db.test.com ";
};

Create two files: db.test.com and db.202.117.15

Sudo touch/etc/bind/db.202.117.15
Sudo vi/etc/bind/db.202.117.15

Modify:

; Db.202.117.15
;
$ TTL 604800
@ In soa ubuntu.test.com. root.ubuntu.test.com. (; configure the DNS authoritative server IN the current region
1; serial
6040800; refresh
86400; retry
2419200; expire
604800); negative cache ttl;
@ In ns ubuntu.test.com .; I don't know why there is a @. Everyone writes it like this and adds it ". "relatively good, otherwise there will be a string of things after translation
165 in ptr ubuntu.test.com.

Db.test.com

Sudo touch/etc/bind/db.test.com
Sudo vi/etc/bind/db.test.com

Modify:

; Db.test.com
;
$ TTL 604800
@ In soa ubuntu.test.com. root.ubuntu.test.com .(
1;
604800;
86400;
2419200;
604800 );
@ In ns ubuntu.test.com
Ubuntu in a 202.117.15.165; A cannot be followed by A name. IN this case, ubuntu in a ns reports an error during nslookup.
Www in cname ubuntu

We use NSLookup to test and disable 202.117.0.20 and 202.117.0.21.

Xjtu129 @ xjtu129-desktop:/etc/bind $ nslookup
> Ubuntu.test.com
Server: 127.0.0.1
Address: 127.0.0.1 #53

Name: ubuntu.test.com
Address: 202.117.15.165
> Www.test.com
Server: 127.0.0.1
Address: 127.0.0.1 #53

Www.test.com canonical name = ubuntu.test.com.
Name: ubuntu.test.com
Address: 202.117.15.165
> 202.117.15.165
Server: 127.0.0.1
Address: 127.0.0.1 #53

165.15.117.202.in-addr. arpa name = ubuntu.test.com. 15.117.202.in-addr. arpa. The following string appears because "." is not added before.
>

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.