日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux 内核配置 dns,linux bind dns简单配置

發(fā)布時間:2023/12/1 linux 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 内核配置 dns,linux bind dns简单配置 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

操作系統(tǒng)版本:

[root@test ~]# cat /etc/issue

Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

Kernel r on an m

內(nèi)核:

[root@test ~]# uname -a

Linux test 2.6.9-42.EL #1 Wed Jul 12 23:16:43 EDT 2006 i686 i686 i386 GNU/Linux

[root@test ~]#

需要安裝的軟件:

[root@test ~]# rpm -aq | grep bind

bind-9.2.4-16.EL4

bind-utils-9.2.4-16.EL4

bind-chroot-9.2.4-16.EL4

bind-libs-9.2.4-16.EL4

ypbind-1.17.2-8

[root@test ~]# rpm -aq | grep caching-nameserver

caching-nameserver-7.3-3

[root@test ~]#

1,修改配置文件:

[root@test etc]# pwd

/var/named/chroot/etc

[root@test etc]# vi named.conf

添加如下行到配置文件中

zone "example.com" IN{

type master;

file "example.com.zone";

};

zone "25.172.in-addr.arpa" IN {

type master;

file "example.com.local";

};

2,添加zone文件:

[root@test etc]# cd ../var/named/

[root@test named]# pwd

/var/named/chroot/var/named

[root@test named]# ls

data localdomain.zone localhost.zone named.broadcast named.ca named.ip6.local named.local named.zero slaves

[root@test named]# cp localdomain.zone example.com.zone

[root@test named]# cp named.local example.com.local

[root@test named]#

3,修改example.com.zone文件,在文件末尾添加A記錄:

. IN A 172.25.1.111

bbs IN A 172.25.1.112

第一行是完整寫法,第二行是省略寫法,效果一樣。

4,修改example.com.local文件,在文件末尾添加PTR記錄:

111.1.25.172.IN-ADDR-ARPA IN PTR .

112 IN PTR bbs.example.com.

5,修改這個兩個文件的權(quán)限。

[root@test named]# chmod 644 example.com.*

[root@test named]#

6,啟動named.

[root@test named]# service named start

Starting named: [ OK ]

[root@test named]#

啟動的日志信息:

Apr 14 13:21:19 test named[22327]: starting BIND 9.2.4 -u named -t /var/named/chroot

Apr 14 13:21:19 test named[22327]: using 1 CPU

Apr 14 13:21:19 test named[22327]: loading configuration from '/etc/named.conf'

Apr 14 13:21:19 test named[22327]: listening on IPv4 interface lo, 127.0.0.1#53

Apr 14 13:21:19 test named[22327]: listening on IPv4 interface eth0, 172.25.1.114#53

Apr 14 13:21:19 test named[22327]: command channel listening on 127.0.0.1#953

Apr 14 13:21:19 test named[22327]: zone 0.in-addr.arpa/IN: loaded serial 42

Apr 14 13:21:19 test named[22327]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700

Apr 14 13:21:19 test named[22327]: zone 25.172.in-addr.arpa/IN: loaded serial 1997022700

Apr 14 13:21:19 test named[22327]: zone 255.in-addr.arpa/IN: loaded serial 42

Apr 14 13:21:19 test named[22327]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700

Apr 14 13:21:19 test named[22327]: zone example.com/IN: loaded serial 42

Apr 14 13:21:19 test named[22327]: zone localdomain/IN: loaded serial 42

Apr 14 13:21:19 test named[22327]: zone localhost/IN: loaded serial 42

Apr 14 13:21:19 test named[22327]: running

Apr 14 13:21:19 test named: named startup succeeded

7, 配置dns客戶機.

[root@test named]# cat /etc/resolv.conf

search example.com

nameserver 172.25.1.114

[root@test named]#

8, 測試:

正向解析可以,逆向解析有問題:

[root@test named]# nslookup

> 172.25.1.111

Server: 172.25.1.114

Address: 172.25.1.114#53

** server can't find 111.1.25.172.in-addr.arpa: NXDOMAIN

>

Server: 172.25.1.114

Address: 172.25.1.114#53

Name:

Address: 172.25.1.111

> exit

[root@test named]#

9,修改反向解析的配置文件,把最后兩行更改為:

111.1 IN PTR .

112.1 IN PTR bbs.example.com.

這個是簡單配置。

重啟named服務(wù),然后測試就可以了。

[root@test named]# nslookup

> 172.25.1.111

Server: 172.25.1.114

Address: 172.25.1.114#53

111.1.25.172.in-addr.arpa name = .

總結(jié)

以上是生活随笔為你收集整理的linux 内核配置 dns,linux bind dns简单配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。