The construction of DNS under Linux

Source: Internet
Author: User

1. Software Installation:

Redhat using bind as the installation software by default

Install yum install-y bind bind-chroot bind-utils with Yum

Bind provides the main program

Bind-chroot provides the configuration file mount. Objective: To improve the security of the system.

Bind-utils provides some small tools for DNS. such as Named-checkzone and so on.

2. Start the service:

Use/etc/init.d.named Start (service named start) to start the services.

<1> Edit the main configuration file, vim/var/named/chroot/etc/named.conf.

////named.conf////provided by Red Hat bind package To configure the ISC bind named (8) DNS//server as a caching only nameserver (as a localhost, DNS resolver only).////see/usr/share/doc/bind*/sample/for example named configuration files.//Options {Listen-on Port -{any;};//listen-on-v6 Port: (any;};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;}; Recursion yes;# dnssec-Enable yes;# dnssec-Validation yes;# 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"; SeverityDynamic; };}; Zone"."In {type hint; File"named.ca";}; Zone"mylove.cn"In {type master; File"Mylove.cn.zone";}; Include"/etc/named.rfc1912.zones"; include"/etc/named.root.key";
View Code

Modify the 127.0.0.1 in option to any.

Add a zone file of your own domain name

Zone "mylove.cn" in {type Master;file "Mylove.cn.zone";};

  

<2> Create your own zone file

Copy/var/named/chroot/var/named/named.local Rename the same name as your zone file and modify the file contents on this basis

  

Cp-p/var/named/chroot/var/named/named.localhost/var/named/chroot/var/named/mylove.cn.zone

  

Cp-p is used to ensure that file permissions are not problematic

$TTL 1dmylove.cn.in soamylove.cn.  Root.mylove.cn. (0; serial1d; refresh1h; retry1w; expire3h); minimummylove.cn.       nsns.love.cn.ns.mylove.cn.a192.168.1.170www.mylove.cn.a192.168.1.170

In this check the configuration file and zone file

[Email protected] ~]# Named-checkzone Mylove.cn/var/named/mylove.cn.zone
Zone mmm/in:loaded Serial 0
Ok

[Email protected] ~]# named-checkconf

Before these are done, restart the named service! Then test.

It has been resolved successfully!

To be Continued ...

  

  

  

The construction of DNS under Linux

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.