Detailed Liunx Configure the DNS server _linux

Source: Internet
Author: User

The IP address of the host can be mapped when the host name is Ping, and vice versa. Configure and specify that the DNS server can quickly deploy the cluster without requiring each host to modify the hosts file to resolve the IP and host names. In Linux, DNS is implemented with BIND.

Environment:

Machine IP machine name use

10.190.60.5 hadoop01.ftgov--DNS host

10.190.60.6 hadoop02.ftgov--DNS client

10.190.60.7 hadoop03.ftgov--DNS client

Steps briefly

To install the bind command:

 Yum-y Install bind bind-utils bind-chroot

To modify the/etc/named.conf access permission command:

 
 

Modify the/etc/named.rfc1912.zones file and add the forward and reverse configuration commands:

Vim/etc/named.rfc1912.zones

Analytical:

Zone "Ftgov" in {      //When input is similar to "ftgov" suffix such as: hadoop01.ftgov is parsing

    type master;      This is the DNS host

    file "named.ftgov.com";  The parsing file will read the domain name of the named.ftgov.com file in the/var/named directory and the IP mapping configuration (file generated later)

    allow-update {none;};

Zone "60.190.10.in-addr.arpa" in {   //when the input is similar to "10.190.60.xxx" reverse parsing, note the address order

    type master; 

    File "Named.10.190.60.zone";    The anti-solution file is located in the configuration of the Named.10.190.60.zone in the/var/named directory (later generated by the file)

    allow-update {none;};


Generate the positive and reverse solution files that need to be used for the above configuration

    • Open Directory Cd/var/named
    • Generate File Named.ftgov.com

Configure named.ftgov.com

Generate File Named.10.190.60.zone

Configuration

Configuring additional DNS Clients

1. First use ifconfig to see the current client is using which network card like my machine: with the ETH1 network card

2. Modify the document

 Vim/etc/sysconfig/network-scripts/ifcfg-eth1   //specifically modify the name of the network card you are currently using

The last line plus a row of DNS host IP

3. Restart Client Network Services

Command:

Service Network restart

4. Other clients the same operation

Start the DNS server

Start command:

Service named start

To see if the service is normal: Tail-n 30/var/log/messages |grep named

Testing the DNS Service

Positive solution:

Inverse solution:

Done.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.