您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關DNS服務器如何配置,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
BIND9(Solaris 10中的DNS服務器是BIND9)總共需要這些配置文件:
/etc/目錄下的文件(這些文件的名字不可更改):
/etc/named.conf---------in.named daemon的配置文件
/etc/rndc.conf------------BIND9必須的配置文件
/etc/named/目錄下的文件(這個目錄名和文件名均可在/etc/named.conf文件中任意定義):
named.root
loop.back
one.rzone
one.zone
/*****************named.conf文件的內容***********************/
// This is the /etc/named.boot (boot files) for the primary name server
// of the one.edu. domain.
//
首先定義配置文件的位置:
directory "/etc/named";
//
定義轉發器,除了本機定義的域外其他所有請求都發向轉發器(非官方授權的DNS服務器基本上都要定義轉發器)
forwarders {
202.101.98.54;
202.101.98.55;
};
};
//
接下來指定根DNS服務器的配置文件,此文件可從網絡下載:
zone "." in {
type hint;
file "named.root";
};
//
本機負責解析的域的正向解析配置文件,此例中為one.edu域,配置文件為one.zone
zone "one.edu" in {
type master;
file "one.zone";
};
//
本機負責解析的域的反向解析配置文件,此例中為one.edu域,配置文件為one.zone
zone "1.168.192.in-addr.arpa" in {
type master;
file "one.rzone";
};
//環回反向解析配置文件
zone "0.0.127.in-addr.arpa" in {
type master;
file "loop.back";
};
//
下面是BIND9專用的配置內容
// Use with the following in named.conf, adjusting the allow list as needed:
// See rndc-confgen command-manual
key "rndc-key" {
algorithm hmac-md5;
secret "/cCelQY6sE40JIwQDtXf6g==";
};
controls {
inet * allow { any; } keys { "rndc-key"; };
};
/*
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};*/
/*****************rndc.conf文件的內容,可用rndc-confgen命令生成所需內容******************/
key "rndc-key" {
algorithm hmac-md5;
secret "/cCelQY6sE40JIwQDtXf6g==";
};
options {
default-key "rndc-key";
default-server localhost;
default-port 953;
};
server localhost {
key "rndc-key";
};
/*****************/etc/named/目錄中的文件****************************/
/********/etc/named/named.root**********/
這個文件內容從網絡上下載,不看也罷
/********/etc/named/loop.back**********/
; /var/named/loop.back file for the primary name server.
;
; Start of Authority section
$ORIGIN 0.0.127.IN-ADDR.ARPA.
;
$TTL 8h
; The next line is very long, but is ONE line.
0.0.127.IN-ADDR.ARPA. IN SOA sys11.one.edu. root.sys11.one.edu. (
20011225 ; version number
10800 ; refresh (3hrs.)
3600 ; retry (1hr.)
432000 ; expire (5days)
86400 ) ; ttl (1day)
0.0.127.IN-ADDR.ARPA. IN NS sys11.one.edu.
1 IN PTR localhost.one.edu.
/********/關鍵是正向解析文件和反向解析文件**********/
/********/etc/named/one.zone **********/
; /var/named/one.zone file for the one.edu. name server
; This file resolves hostnames to IP addresses in the one.edu. domain.
;
$ORIGIN one.edu.
; Time to live (post BIND 8.2) 8 hours
$TTL 8h
one.edu. IN SOA sys11.one.edu. root.sys11.one.edu. (
20011225 ; serial number
10800 ; refresh (3hrs)
3600 ; retry (1hr)
432000 ; expire (5days)
86400 ) ; ttl (1day)
;
; Domain Section
;下面這條意思是one.edu這個域由sys11.one.edu這臺主機負責解析
one.edu. IN NS sys11.one.edu.
;
; Host Information Section
; Example; "sys12 IN A 192.168.1.2"
;下面就是主機和IP的對應關系了,sys11 IN A 192.168.1.1就表示sys11.one.edu這個域名的IP為192.168.1.1
sys11 IN A 192.168.1.1
sys12 IN A 192.168.1.2
sys13 IN A 192.168.1.3
sys17 IN A 192.168.1.17
gw IN A 192.168.1.254
xp IN A 192.168.1.11
/********/etc/named/one.rzone **********/
; /var/named/one.rzone file for the one.edu. primary name server
; This file resolves IP addresses to hostnames in the one.edu. domain.
;
$ORIGIN 1.168.192.IN-ADDR.ARPA.
; Time to live (post BIND 8.2) 8 hours
$TTL 8h
1.168.192.IN-ADDR.ARPA. IN SOA sys11.one.edu. root.sys11.one.edu. (
20011225 ; serial number
10800 ; refresh (3hrs)
3600 ; retry (1hr)
432000 ; expire (5days)
86400 ) ; ttl (1day)
1.168.192.IN-ADDR.ARPA. IN NS sys11.edu.
; In this section put ONLY the host portion of IP address for each
; host in the one.edu domain. ex. "1 IN PTR sys11.one.edu."
1 IN PTR sys11.one.edu.
2 IN PTR sys12.one.edu.
3 IN PTR sys13.one.edu.
17 IN PTR sys17.one.edu.
254 IN PTR gw.one.edu.
關于“DNS服務器如何配置”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。