Configure the DNS server

Source: Internet
Author: User

Tag: Restore contains port TTL run using--Manage DNS forwarding

First, configure the basic DNS server (including forward parsing and reverse parsing)
Domain Name: abc.com
Server ip:10.1.2.11

1. Edit the Master profile/etc/named.conf
----------------------------------------------------
Options {
Listen-on Port: (any;}; <--change to any to listen on all local IP addresses
Listen-on-v6 Port 53 {:: 1;};
Directory "/var/named";
Dump-file "/var/named/data/cache_dump.db";
Statistics-file "/var/named/data/named_stats.txt";
Memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query {any;}; <--allow anyone to query
recursion Yes;

Dnssec-enable No;
Dnssec-validation No;
Dnssec-lookaside Auto;

/* Path to ISC DLV key */
Bindkeys-file "/etc/named.iscdlv.key";

Managed-keys-directory "/var/named/dynamic";
};

Logging {
Channel Default_debug {
File "Data/named.run";
Severity dynamic;
};
};

Zone "." in {
Type hint;
File "named.ca";
};

Include "/etc/named.rfc1912.zones";
Include "/etc/named.root.key";
----------------------------------------------------


2. Configure the Zone declaration file/etc/named.rfc1912.zones, add a domain and its reverse resolution domain
----------------------------------------------------
Zone "ABC.com" in {
Type master;
File "Data/master.abc.com.zone";
};
Zone "2.1.10.in-addr.arpa" in {
Type master;
File "Data/master.1.1.10.in-addr.arpa.zone";
};
----------------------------------------------------


3. Configure the Zone database file
Forward parsing domain/var/named/data/master.abc.com.zone
----------------------------------------------------
$TTL 3600
@ in SOA dns.abc.com. Root.abc.com. (
2014051901 <--version number, below is a variety of time, if not the master from the structure, these can be arbitrarily written
<--Slave Active Contact Master interval
<--Slave retry interval failed from Master Update
<--How long does it take to stop the service without contacting master? Slave
3600) <--cache time for negative answers
In NS dns.abc.com. <--specifying authoritative DNS servers in this domain
DNS in A 10.1.1.1 <--DNS server address
Mail in a 10.1.1.1 <--a record is the IP address of the host
Host1 in A 10.1.1.11
----------------------------------------------------

Reverse parsing domain/var/named/data/master.1.1.10.in-addr.arpa.zone
----------------------------------------------------
$TTL 86400
@ in SOA dns.abc.com. Root.abc.com. (
2014051901
30
60
90
3600)
In NS dns.abc.com. <--specifying authoritative DNS servers in this domain
One in PTR host1.abc.com.
----------------------------------------------------


4. Start service named start
When you start the service for the first time, the file/etc/rndc.key is created, approximately 1.5, and if you do not want to wait, you can use the following techniques to circumvent it:
[[email protected] ~]# Mv/dev/random/dev/random.orig <--back up the original random file
[[email protected] ~]# cp-a/dev/urandom/dev/random <--Copying a copy of urandom to do random
[[Email protected] ~]# service named start <--then start the DNS server again and it will be completed soon
[[email protected] ~]# mv-f/dev/random.orig/dev/random <--recover random


5. Testing
Change the system's domain name server to the name server you just created
Vi/etc/resolv.conf
NameServer 10.1.1.1

Test with Command nslookup
Nslookup dns.abc.com

, configure DNS forwarding:
The DNS we configured is only able to parse our defined zone, which we do not define is unresolved.
DNS forwarding can be configured to resolve other Internet domain names, provided that the domain name in the Internet is indeed in use, that is, the domain name has been resolved by a DNS server.
vim/etc/named.conf//Add in options{}
Forward first;
Forwarders {8.8.8.8;};
These two lines are used to configure the forwarding, the DNS server cannot resolve the domain name will be forwarded to 8.8.8.8 this DNS server to parse.

Configure the 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.