Establishing a name server

Source: Internet
Author: User
Tags nameserver nslookup

First, the purpose of the experiment:
Implement DNS server functionality to provide forward, reverse resolution


Second, the experimental environment
Windows system with Linux installed
Virtual machines with IP 192.168.6.3
   
Iii. purpose of the experiment
Establish the primary name server for the gr.org domain. Analytical:
Name IP Purpose
ns.gr.org 192.168.6.3 Name Server
www.gr.org 192.168.6.3 Regular Name
bbs.gr.org 192.168.6.3 Aliases
mail.gr.org 192.168.6.4 Mail Server


Iv. experimental Process (write out the output on the screen, make the necessary comments or explanations)
1. configuration file/etc/named.conf
To back up the file:
#cp/etc/named.conf/etc/named.conf.sample
#
Modify the file to insert before the last line:


Zone "gr.org" {
Type master;
File "Gr.org.db";
};


Zone "6.168.192.in-addr.arpa" {
Type master;
File "192.168.6.db";
};


[Email protected] root]# cp/etc/named.conf/etc/named.conf.sample
[Email protected] root]# vi/etc/named.conf
Before the last line, enter the following:
Zone "gr.org" {
Type master;
File "Gr.org.db";
};


Zone "6.168.192.in-addr.arpa" {
Type master;
File "192.168.6.db";
};


2. Create the forward zone file/var/named/gr.org.db
The contents are:
$TTL 86400
@ in SOA ns.gr.org. Root.gr.org. (
20140308; serial
8H; refresh
4H; retry
6W; expiry
1D); minimum
In NS ns.gr.org.
In MX ten mail.gr.org.
BBS in CNAME www.gr.org.
NS in A 192.168.6.3
www in A 192.168.6.3
Mail in A 192.168.6.4


[Email protected] root]# cd/var/named
[email protected] named]# cat > Gr.org.db
$TTL 86400
@ in SOA ns.gr.org. Root.gr.org. (
20140308; serial
8H; refresh
4H; retry
6W; expiry
1D); minimum
In NS ns.gr.org.
In MX ten mail.gr.org.
BBS in CNAME www.gr.org.
NS in A 192.168.6.3
www in A 192.168.6.3
Mail in A 192.168.6.4




3. Create a reverse zone file/var/named/192.168.6.db
The contents are:
$TTL 86400
@ in SOA gr.org. Root.gr.org. (
20140308; serial
8H; refresh
4H; retry
6W; expiry
1D); minimum
In NS ns.gr.org.
3 in PTR ns.gr.org.
3 in PTR www.gr.org.
4 in PTR mail.gr.org.


[email protected] named]# cat >/var/named/192.168.6.db
$TTL 86400
@ in SOA gr.org. Root.gr.org. (
20140308; serial
8H; refresh
4H; retry
6W; expiry
1D); minimum
In NS ns.gr.org.
3 in PTR ns.gr.org.
3 in PTR www.gr.org.
4 in PTR mail.gr.org.


4. See if named is started:
#ps-ax | grep named


[Email protected] named]# Ps-ax | grep named
  
#
Start:
#service named start


[[Email protected] named]# service named start
[[Email protected] named]# [OK]


5, the client configuration file/etc/resolv.conf content is:
NameServer 192.168.6.3


[Email protected] root]# vi/etc/resolv.conf
Modified to NameServer 192.168.6.3


6. Testing
#nslookup-sil bbs.gr.org


[Email protected] root]# Nslookup-sil bbs.gr.org
server:172.16.1.5
address:172.16.1.5#53


bbs.gr.org canonical name = www.gr.org.
Name:www.gr.org
address:192.168.6.3


#host bbs.gr.org

[Email protected] root]# host bbs.gr.org
Bbs.gr.org is a alias for www.gr.org.
Www.gr.org has address 192.168.6.3


#nslookup-sil mail.gr.org


[Email protected] root]# Nslookup-sil mail.gr.org
server:172.16.1.5
address:172.16.1.5#53


Name:mail.gr.org
address:192.168.6.4


#nslookup-sil 192.168.6.4


[Email protected] root]# Nslookup-sil 192.168.6.4
server:172.16.1.5
address:172.16.1.5#53


4.6.168.192.in-addr.arpa name = mail.gr.org.


#nslookup-sil 192.168.6.3


[Email protected] root]# Nslookup-sil 192.168.6.3
server:172.16.1.5
address:172.16.1.5#53


3.6.168.192.in-addr.arpa name = ns.gr.org.
3.6.168.192.in-addr.arpa name = Www.gr.o.6.168.192.in-addr.arpa.




7. Windows Client Testing
Disable the local Area connection and set the DNS for VMNET8 to 192.168.6.3.
Execute command:
C:>ping www.gr.org


C:\>ping www.gr.org


Ping www.gr.org [192.168.6.3] has 32 bytes of data:
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64


Ping Statistics for 192.168.6.3:
Packet: Sent = 4, received = 4, lost = 0 (0% missing),
Estimated time to round trip (in milliseconds):
Shortest = 0ms, longest = 0ms, average = 0ms


C:>ping bbs.gr.org


C:>ping bbs.gr.org


Ping www.gr.org [192.168.6.3] has 32 bytes of data:
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64
Reply from 192.168.6.3: Byte =32 time <1ms ttl=64


Ping Statistics for 192.168.6.3:
Packet: Sent = 4, received = 4, lost = 0 (0% missing),
Estimated time to round trip (in milliseconds):
Shortest = 0ms, longest = 1ms, average = 0ms






Five, the experience of experiment


Too careless, made a number of mistakes several times.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Establishing a name 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.