bind9 遇到的問題,解析超時

2022-07-11 19:39:11 字數 2276 閱讀 7551

1,現象

[c:\~]$ nslookup

預設伺服器: unknown

address: 10.1.1.1

> server 172.30.0.1

dns request timed out.

timeout was 2 seconds.

預設伺服器: [172.30.0.1]

address: 172.30.0.1

> uat.bacic.com

*** 請求 [172.30.0.1] 超時

伺服器: [172.30.0.1]

address: 172.30.0.1

dns request timed out.

timeout was 2 seconds.

dns request timed out.

timeout was 2 seconds.

dns request timed out.

timeout was 2 seconds.

2,直接設定server 172.30.1.1 解析是超時的,應該就是本地安裝的dns解析失敗了,一直都沒有解析到

3,檢查配置

cat /etc/named.rfc1912.zones

////

provided by red hat caching-nameserver package

////

isc bind named zone configuration for zones recommended by

//rfc 1912 section 4.1 : localhost tlds and address zones

//and

//(c)2007 r w franks

////

see /usr/share/doc/bind*/sample/ for example named configuration files.

//zone

"localhost.localdomain

"in ;

};zone

"localhost

"in ;

};zone

"1.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 ;

};zone

"1.0.0.127.in-addr.arpa

"in ;

};zone

"0.in-addr.arpa

"in ;

};

配置裡面沒有bacic.com.zone 的配置檔案

增加如下配置

zone "

bacic.com

"in ;

};

在/var/named 增加bacic.com.zone的檔案

$ttl 1d

$origin bacic.com.

@ in soa cbsv.bacic5i5j.com. admin.com. (

20170526

; serial

1d ; refresh

1h ; retry

1w ; expire

3h ) ; minimum

bacic.com. in ns ns1.bacic.com.

ns1 in a

172.30.1.22

harbor in a

172.30.1.64

pinpoint in a

172.30.1.53

grafana in a

172.30.1.42

uat in a

172.30.1.22

4,systemctl restart named 重啟

5,常用命令

dig uat.bacic.com @172.30.1.1 直接解析dns

no errror 表示解析正確,查詢成功

nxdomain 表示伺服器提示不存在這樣的名稱

servfail 表示伺服器停機或者dnssec響應驗證失敗

refused dns拒絕回答(也許是出於訪問控制的原因)

nslookup uat.bacic.com 解析dns

nslookup 

sever 172.30.1.1 指定dns

uat.bacic.com

rndc reload 可以直接生效dns配置

Bind9泛網域名稱解析配置

我們在專案中,需要在ingress中動態部署服務,每個服務的主機名不同,如module1.ml.irmp.cc module2.ml.irmp.cc,這需要每部署乙個服務後,同時要配置主機ip解析,讓 ml.irmp.cc都解析到同乙個ingress的node的ip,這顯然不能接受。於是,我們就要借...

bind9的一些配置

etc bind named.conf.options options 監聽在主機的53埠上。any代表監聽所有的主機 directory var named 如果此檔案底下有規範到正反解的zone file 檔名時,該檔名預設應該放置在哪個目錄底下 下面三項是服務的相關統計資訊 dump file...

bind9原始碼分析 檢視A記錄的資料組織

方法 gdb除錯時,如下可以看到某一node節點資料,gdb p rdatasetheader t dns rbtdb t dns zone t named g server viewlist head zonetable table root data db tree root down data...