RedHatCentOS build DNS server forward resolution

Source: Internet
Author: User
Tags nameserver nslookup
The following is a forward resolution (IP192.168.1.2 domain name is www.linuxidc.com) based on the RedHat5 or CentOS system. to ensure the construction is successful, do not miss any step. The following is a detailed step-by-step command to ensure the success! (For reverse resolution steps, refer to the next article) 1. install related software packages: follow the steps below for forward resolution based on RedHat 5 or CentOS system (IP192.168.1.2 domain name is www.linuxidc.com) to ensure successful construction, the following are detailed steps to execute commands one by one to ensure success! (For reverse resolution steps, refer to the next article)

1. install related software packages: to ensure smooth operation, follow these steps to delete and reinstall all software packages.

[Root @ server ~] # Rpm-qa | grep bind // view bind related software packages


[Root @ server ~] # Rpm-e 'rpm-qa | grep bind' -- nodeps // delete related software packages
[Root @ server ~] # Mount/dev/cdrom/media // mount the system disk to/media/
[Root @ server media] # cd/media/Server // enter the/media/Server/Directory
[Root @ server Server] # rpm-vih bind-* // reinstall the software package
[Root @ server Server] # rpm-vih caching-nameserver-9.3.3-7.el5.i386.rpm
[Root @ server Server] # service named start // restart the named service


2. modify the master configuration file
[Root @ server Server] # cd/var/named/chroot/etc // enter the/var/named/chroot/etc/Directory
[Root @ server etc] # vim named. caching-nameserver.conf // modify the master configuration file
----------------------------------------------------------------------
Options {
Listen-on port 53 {any ;}; // modify it to any
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 ";
Query-source port 53;
Query-source-v6 port 53;
Allow-query {any ;}; // modify it to any
};
Logging {
Channel default_debug {
File "data/named. run ";
Severity dynamic;
};
};
View localhost_resolver {
Match-clients {any ;}; // modify it to any
Match-destinations {any ;}; // modify it to any
Recursion yes;
Include "/etc/named. rfc1912.zones ";
};
----------------------------------------------------------------------

3. modify the extension file of the host configuration file
[Root @ server etc] # vim named. rfc1912.zones // modify the host configuration file extension and add it in the last line
----------------------------------------------------------------------
Zone "linuxidc.com" IN {// IN can be unavailable
Type master; // type-based domain
File "linuxidc.com"; // domain configuration file
};
---------------------------------------------------------------------
4. create a domain configuration file for linuxidc.com

[Root @ server etc] # cd/var/named/chroot/var/named // enter the/var/named/chroot/var/named/Directory
[Root @ server named] # cp named. local linuxidc.com // Copy the domain configuration file
[Root @ server named] # vim linuxidc.com
--------------------------------------------------------------------
$ TTL 86400
@ In soa localhost. root. localhost .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns localhost.
Www in a 192.168.1.2 // modify the last line to... (this line)

--------------------------------------------------------------------
[Root @ server named] # bind-chroot-admin-s // automatically sets the group and permissions
[Root @ server named] # service named restart // restart the named service
5. test and verification

[Root @ localhost ~] # Nslookup // verify that the resolution is successful on the local machine
> Www.linuxidc.com
Server: 192.168.1.2
Address: 192.168.1.2 #53

Name: www.linuxidc.com
Address: 192.168.1.2

C: authentication Ents and SettingsAdministrator> nslookup // The authentication is successful when the remote windows server is lying.
* ** Cant find server name for address 219.244.93.2: Non-existent domain
* ** Default servers are not available
Default Server: UnKnown
Address: 219.244.93.2 // The original DNS is 219.244.93.2

> Server 192.168.1.2 // modify the DNS host
Default Server: [192.168.1.2]
Address: 192.168.1.2

> Www.linuxidc.com
Server: [192.168.1.2]
Address: 192.168.1.2

Name: www.linuxidc.com
Address: 192.168.1.2
 
Related Article

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.