Configure the DNS service in Liunx and the DNS service in Liunx

Source: Internet
Author: User

Configure the DNS service in Liunx and the DNS service in Liunx

When you Ping the host name, you can map the IP address of the host, and vice versa. Configure and specify the DNS server to quickly deploy the cluster. You do not need to modify the HOSTS file on each host to resolve the IP address and host name. In Linux, DNS is implemented using bind.

  • Environment:

Machine IP machine name usage

10.190.60.5 hadoop01.ftgov-DNS host

10.190.60.6 hadoop02.ftgov-DNS Client

10.190.60.7 hadoop03.ftgov-DNS Client

 

Procedure
  • Install bind

Command: yum-y install bind-utils bind-chroot

  • Modify/etc/named. conf access permission

Command: vim/etc/named. conf

  • Modify the/etc/named. rfc1912.zones file and add the forward and reverse resolution configurations.

Command: vim/etc/named. rfc1912.zones

Resolution:

Zone "ftgov" IN {// parse when the input is similar to the "ftgov" suffix, for example, hadoop01.ftgov

Type master; // This is a dns host

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

Allow-update {none ;};

};

Zone "60.190.10.in-addr. arpa" IN {// reverse resolution when the input is similar to "10.190.60.xxx". Pay attention to the address order.

Type master;

File "named.10.190.60.zone"; // The Reverse file is located in the configuration of named.10.190.60.zone in the/var/named directory (the file will be generated later)

Allow-update {none ;};

};

  • Generate the forward and reverse file required for the above Configuration
    • Open the directory cd/var/named
    • Generate file named.ftgov.com

  • Configure named.ftgov.com

  • Generate file named.10.190.60.zone

  • Configuration

  • Configure other DNS clients

1. First Use ifconfig to check which Nic is used by the current client, such as my host: eth1 Nic

2. Modify the file

Vim/etc/sysconfig/network-scripts/ifcfg-eth1 // change to the name of the NIC you are currently using

Add the IP address of the DNS host to the last line.

3. Restart the client NETWORK SERVICE

Command: service network restart

4. perform the same operations on other clients.

  • Start the DNS server

Start command: service named start

Check whether the service is normal: tail-n 30/var/log/messages | grep named

  • Test DNS Service

Positive Solution:

Reverse Solution:

Done.

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.