PowerDNS 和一个奇怪的 NXDomain

PowerDNS 和一个奇怪的 NXDomain

请允许我首先介绍一下背景。

我们曾经使用过 Bind9,但后来放弃了它而选择了 PowerDNS,因为坦率地说,Bind 很糟糕。

我们的 DNS 主服务器中有一个“主要”区域。 london.wibblesplat.com 还有其他区域,oob.london.wibblesplat.com

非 oob 区域中的大多数地址都在该范围内。dns 192.168.0.0/16. -1 服务器的 IP 是192.168.123.140。(我不确定这是否相关)。

我想在以下范围内向 oob.london.wibblesplat.com 区域添加一些带外 (oob) 访问 IP172.16.254.0/24

这就是驱动 powerdns 的数据库中的内容。

    powerdns=# select * from records where name like '%switch%';
   id   | domain_id |                        name                        | type |    content    | ttl  | prio | change_date | ordername | auth 
--------+-----------+----------------------------------------------------+------+---------------+------+------+-------------+-----------+------
 190709 |        24 | renderchassis-1-switch-A1.london.wibblesplat.com | A    | 172.16.254.12 | 3600 |    0 |  1328715923 |           | 
 190710 |        24 | renderchassis-1-switch-A2.london.wibblesplat.com | A    | 172.16.254.3  | 3600 |    0 |  1328715923 |           | 
 190711 |        24 | renderchassis-2-switch-A1.london.wibblesplat.com | A    | 172.16.254.2  | 3600 |    0 |  1328715923 |           | 
 190712 |        24 | renderchassis-2-switch-A2.london.wibblesplat.com | A    | 172.16.254.13 | 3600 |    0 |  1328715923 |           | 
(4 rows)

这是 dig 所说的。

tom.oconnor@charcoal-black:~$ dig renderchassis-1-switch-A1 +search
; <<>> DiG 9.7.0-P1 <<>> renderchassis-1-switch-A1 +search
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 28586
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;renderchassis-1-switch-A1.london.wibblesplat.com. IN A

;; AUTHORITY SECTION:
london.wibblesplat.com. 1800    IN  SOA dns1.london.wibblesplat.com. hostmaster.london.wibblesplat.com. 2012020803 28800 7200 604800 86400

;; Query time: 2 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 15:58:53 2012
;; MSG SIZE  rcvd: 120

为什么 PowerDNS 没有提供该记录?它存在。查询应该没问题。如果 A 记录不在服务器有权访问的子网中,区域无法提供服务,这有什么奇怪的吗?(我觉得这不对,如果我想(无论出于什么原因)重新发布 8.8.8.8 或其他地址的 A 记录,该怎么办)。

有什么想法吗?

编辑:

情节越来越复杂。出于兴趣,我删除了旧记录,并添加了一些新的、更短的记录。

powerdns=# select * from records where name like '%rc1sw%' or content like '%rc1sw%';
   id   | domain_id |            name             | type |    content    | ttl  | prio | change_date | ordername | auth 
--------+-----------+-----------------------------+------+---------------+------+------+-------------+-----------+------
 190810 |        23 | rc1sw1.london.wibblesplat.com | A    | 172.16.254.12 | 3600 |    0 |  1328720986 |           | 
 190811 |        23 | rc1sw2.london.wibblesplat.com | A    | 172.16.254.3  | 3600 |    0 |  1328720999 |   

    | 

现在.. tom.oconnor@charcoal-black:~$ dig rc1sw1 +search

; <<>> DiG 9.7.0-P1 <<>> rc1sw1 +search
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32849
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;rc1sw1.london.wibblesplat.com. IN  A

;; ANSWER SECTION:
rc1sw1.london.wibblesplat.com. 3600 IN  A   172.16.254.12

;; Query time: 0 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:10:35 2012
;; MSG SIZE  rcvd: 61

并且它有效。

看来 Powerdns 可能不喜欢-名称中有这么多字符。我会记住这一点,并继续下去。不过,答案可能不错。

好的,它不喜欢-A1。

看看这个。

powerdns=# select * from records order by id desc limit 5;
   id   | domain_id |              name               | type |             content             | ttl  | prio | change_date | ordername | auth 
--------+-----------+---------------------------------+------+---------------------------------+------+------+-------------+-----------+------
 190830 |        23 | bunt-1-A1.london.wibblesplat.com  | A    | 127.0.0.1                       |  120 |    0 |  1328722058 |           | 
 190829 |        22 | 80.124.168.192.in-addr.arpa.    | PTR  | claret-red.london.wibblesplat.com | 3600 |    0 |  1328722007 |           | 
 190828 |        23 | claret-red.london.wibblesplat.com | A    | 192.168.124.80                  | 3600 |    0 |  1328722007 |           | 
 190825 |        23 | BUNT.london.wibblesplat.com       | A    | 127.0.0.1                       |  120 |    0 |  1328721975 |           | 
 190824 |        23 | bunt.london.wibblesplat.com       | A    | 127.0.0.1                       |  120 |    0 |  1328721967 |    

   | 

tom.oconnor@charcoal-black:~$ dig bunt +search

; <<>> DiG 9.7.0-P1 <<>> bunt +search
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34027
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;bunt.london.wibblesplat.com.   IN  A

;; ANSWER SECTION:
bunt.london.wibblesplat.com. 120    IN  A   127.0.0.1

;; Query time: 1 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:27:15 2012
;; MSG SIZE  rcvd: 59

tom.oconnor@charcoal-black:~$ dig BUNT +search

; <<>> DiG 9.7.0-P1 <<>> BUNT +search
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60125
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;BUNT.london.wibblesplat.com.   IN  A

;; ANSWER SECTION:
BUNT.london.wibblesplat.com. 120    IN  A   127.0.0.1

;; Query time: 0 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:27:20 2012
;; MSG SIZE  rcvd: 59


tom.oconnor@charcoal-black:~$ dig bunt-1-A1 +search

; <<>> DiG 9.7.0-P1 <<>> bunt-1-A1 +search
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 22009
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;    ; QUESTION SECTION:
;bunt-1-A1.         IN  A

;; AUTHORITY SECTION:
.           1800    IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2012020801 1800 900 604800 86400

;; Query time: 59 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:27:53 2012
;; MSG SIZE  rcvd: 102

答案1

PostgreSQL 至少在默认的 PowerDNS 表架构下区分大小写。PowerDNS 将所有查询都小写。因此,请确保始终将您的名称小写。

答案2

因此,看起来 PowerDNS 对某些配置中的大写字符串有很大的影响。

它接受 BUNT 和 bunt,但不接受 bunt-1-A1 或其变体。

请参阅对问题的编辑以及这块挖掘。

tom.oconnor@charcoal-black:~$ dig bunt-A0000.london.wibblesplat.com

; <<>> DiG 9.7.0-P1 <<>> bunt-A0000.london.wibblesplat.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 21482
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;bunt-A0000.london.wibblesplat.com. IN  A

;; AUTHORITY SECTION:
london.wibblesplat.com. 86400   IN  SOA dns-1.london.wibblesplat.com. root.london.wibblesplat.com. 2012020835 28800 14400 2419200 86400

;; Query time: 1 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:39:01 2012
;; MSG SIZE  rcvd: 116

tom.oconnor@charcoal-black:~$ dig bunt-B.london.wibblesplat.com

; <<>> DiG 9.7.0-P1 <<>> bunt-B.london.wibblesplat.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 41445
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;bunt-B.london.wibblesplat.com. IN  A

;; AUTHORITY SECTION:
london.wibblesplat.com. 86400   IN  SOA dns-1.london.wibblesplat.com. root.london.wibblesplat.com. 2012020835 28800 14400 2419200 86400

;; Query time: 1 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:39:09 2012
;; MSG SIZE  rcvd: 112

tom.oconnor@charcoal-black:~$ dig bunt-BUNT.london.wibblesplat.com

; <<>> DiG 9.7.0-P1 <<>> bunt-BUNT.london.wibblesplat.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 57635
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;bunt-BUNT.london.wibblesplat.com.  IN  A

;; AUTHORITY SECTION:
london.wibblesplat.com. 86400   IN  SOA dns-1.london.wibblesplat.com. root.london.wibblesplat.com. 2012020835 28800 14400 2419200 86400

;; Query time: 1 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:39:14 2012
;; MSG SIZE  rcvd: 115

tom.oconnor@charcoal-black:~$ dig buntA1.london.wibblesplat.com

; <<>> DiG 9.7.0-P1 <<>> buntA1.london.wibblesplat.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 29929
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;buntA1.london.wibblesplat.com. IN  A

;; AUTHORITY SECTION:
london.wibblesplat.com. 86400   IN  SOA dns-1.london.wibblesplat.com. root.london.wibblesplat.com. 2012020835 28800 14400 2419200 86400

;; Query time: 1 msec
;; SERVER: 192.168.123.140#53(192.168.123.140)
;; WHEN: Wed Feb  8 17:39:18 2012
;; MSG SIZE  rcvd: 112

相关内容