How to use bind to set up a DNS server in freebsd6.1release

Source: Internet
Author: User
Tags dns2 nslookup tool

Through this server, Intranet users can access the Internet normally. Here we use the BIND provided by FreeBSD to implement DNS resolution. In fact, many DNS servers on the Internet use this software. The basic procedure is as follows:

◇The information given to me by the DNS parent domain (edu.cn) is as follows:
Domain> wxicab.edu.cn
DNS master server-> 58.193.128.55 [dns1.wxicab.edu.cn]
DNS secondary server-> 58.193.128.56 [dns2.wxicab.edu.cn]
(The configuration process of only setting up the master server in this note)

◇Nic Interface Description:
Xl0: 3Com Internet Nic Interface

◇The DNS info table is as follows:
Domain: wxicab.edu.cn
DNS server: dns1.wxicab.edu.cn (58.193.128.55) dns2.wxicab.edu.cn (58.193.128.56)
58.193.128.55-> dns1.wxicab.edu.cn (DNS master server)
58.193.128.56-> dns2.wxicab.edu.cn (DNS secondary server)
58.193.128.53-> wxicab.edu.cn (Web Server)
58.193.128.53-> www.wxicab.edu.cn (Web Server)
58.193.128.52-> mail.wxicab.edu.cn (email server)
58.193.128.51-> ftp.wxicab.edu.cn (File Server)
58.193.128.50-> windowsupdate.wxicab.edu.cn (Windows server upgrade)
58.193.128.49-> virus.wxicab.edu.cn (anti-virus server)

Start installation:

1. Download and install freebsd6.1release
From ftp: // hosts. You can install other services by default. For details, refer to this article.Article. Restart the machine after installation.

2. Basic Configuration
Configure/etc/rc. conf

# Cd/etc
# Ee RC. conf

The content is as follows:
Hostname = "dns1.wxicab.edu.cn"
Defaultrouter = "58.193.128.254"
Ifconfig_xl1 = "Inet 58.193.128.55 netmask 255.255.248.0"
Inetd_enable = "yes"
Linux_enable = "yes"
Sshd_enable = "yes"
Usbd_enable = "yes"

3. Configure DNS

(1) Create and configure/etc/named/db.wxicab.edu.cn (ing from host name to IP address)

# Cd/etc/namedb
# Ee db.wxicab.edu.cn

The content is as follows:
$ TTL 3D
@ In SOA dns1.wxicab.edu.cn. hostmaster.wxicab.edu.cn .(
2006626
3 H
1 H
1 W
1 H)

In NS dns1
In NS dns2

In a 58.193.128.53
In MX 10 mail.wxicab.edu.cn.
Dns1 in a 58.193.128.55
Dns2 in a 58.193.128.56
Mail in a 58.193.128.52
FTP in a 58.193.128.51
Windowsupdate in a 58.193.128.50
Virus in a 58.193.128.49

WWW in cname wxicab.edu.cn.

(2) create and configure/etc/named/db.58.193.128 (ing from IP address to host name)

# Cd/etc/namedb
# Ee db.58.193.128

The content is as follows:
$ TTL 3D
@ In SOA dns1.wxicab.edu.cn. hostmaster.wxicab.edu.cn .(
2006626
3 H
1 H
1 W
1 H)

In NS dns1.wxicab.edu.cn.
In NS dns2.wxicab.edu.cn.
56 in PTR dns1.wxicab.edu.cn.
55 in PTR dns2.wxicab.edu.cn.
53 in PTR wxicab.edu.cn.
52 in PTR mail.wxicab.edu.cn.
51 in PTR ftp.wxicab.edu.cn.
50 in PTR windowsupdate.wxicab.edu.cn.
49 in PTR virus.wxicab.edu.cn.

(3) configure the locahost. Rev file:

# Cd/etc/namedb
# Chmod 755 make-localhost
#./Make-localhost

after running, localhost is automatically generated in the/etc/namedb/Master Directory. rev and localhost-v6.rev two files; localhost-v6.rev is for next generation IP, temporarily unavailable, my localhost. rev file content:

$ TTL 3600
@ In SOA dns1.wxicab.edu.cn. root.dns1.wxicab.edu.cn .(
20060627; Serial
3600; refresh
900; retry
3600000; expire
3600); Minimum
In NS dns1.wxiabc.edu.cn.
1 In PTR localhost.wxicab.edu.cn.

(4) configure the/etc/namedb/named. conf file:

# Cd/etc/namedb
# Ee named. conf

The content is as follows:
Options {
Directory "/etc/namedb ";
PID-file "/var/run/named/PID ";
Dump-file "/var/dump/named_dump.db ";
Statistics-file "/var/stats/named. Stats ";
};
Zone "."{
Type hint;
File "named. Root ";
};
Zone "0.0.127.in-ADDR. Arpa "{
Type master;
File "Master/localhost. Rev ";
};
Zone "wxicab.edu.cn "{
Type master;
File "db.wxicab.edu.cn ";
};
Zone "128.193.58.in-ADDR. Arpa "{
Type master;
File "db.58.193.128 ";
};

(5) Enable the named server and enable it with the System
Add the following line to/etc/rc. conf:

Named_enable = "yes"

Save and exit after editing.

Restart the server and run the TOP command to check if the named process exists. Find a client, set the dns ip address to 58.193.128.55, and Ping edu.cn. If the IP address can be pinged, the resolution is normal. You can also use the NSLookup tool for testing.

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.