尝试使用枚举(voip)dns查询powerdns。
我相信我已经设置正确。
它在MySQL表中似乎是正确的
select * from records\G id: 3 domain_id: 3 name: 0.1.9.2.8.4.3.3.0.7.1.e164.arpa type: NAPTR content: 100 10 "u" "E2U+sip" "!^.*$!sip:[email protected]!" . ttl: 120 prio: NULL change_date: NULL select * from domains\G id: 3 name: e164.arpa master: 127.0.0.1 last_check: NULL type: MASTER notified_serial: NULL account: NULL
我可以看到基于pdns日志的查询:
Jun 8 16:10:47 localhost pdns[12575]: Remote 127.0.0.1 wants '0.1.9.2.8.4.3.3.0.7.1.e164.arpa|NAPTR', do = 0, bufsize = 512: packetcache MISS Jun 8 16:10:47 localhost pdns[12575]: Query: select content,ttl,prio,type,domain_id,name from records where type='SOA' and name='0.1.9.2.8.4.3.3.0.7.1.e164.arpa' Jun 8 16:10:47 localhost pdns[12575]: Query: select content,ttl,prio,type,domain_id,name from records where type='SOA' and name='1.9.2.8.4.3.3.0.7.1.e164.arpa' Jun 8 16:10:47 localhost pdns[12575]: Query: select content,ttl,prio,type,domain_id,name from records where type='SOA' and name='9.2.8.4.3.3.0.7.1.e164.arpa'
但是我的挖掘失败:
dig NAPTR @127.0.0.1 0.1.9.2.8.4.3.3.0.7.1.e164.arpa ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> NAPTR @127.0.0.1 0.1.9.2.8.4.3.3.0.7.1.e164.arpa ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 8911 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;0.1.9.2.8.4.3.3.0.7.1.e164.arpa. IN NAPTR ;; Query time: 4 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Jun 8 16:04:28 2015 ;; MSG SIZE rcvd: 49
我明白为什么在mysql查询中没有结果“type = SOA”,但为什么要尝试type ='SOA'而不是'NAPTR'?
答案是基于HåkanLindqvist的build议:
使logging表如下所示:
id: 6 domain_id: 3 name: someServer.com type: SOA content: ns1.someDNSServer.com ttl: 120 prio: NULL change_date: NULL *************************** 2. row *************************** id: 7 domain_id: 3 name: someServer.com type: NS content: ns1.someDNSServer.com ttl: 120 prio: NULL change_date: NULL
我相信这个问题本身不是与你的NAPTRlogging有关的,但是PowerDNS在它有SOAlogging之前并不认为你的区域有效。
忽略PowerDNS的具体行为,一般来说,DNS中的要求是任何区域都必须至less具有SOA和NSlogging。
(PowerDNS似乎没有validationNS方面,但未能添加这些logging将导致问题。)
我不确定你是否设置了一个完整的e164.arpa区域,但是更一般地说,如果你的区域的名字是foo.example你想要这样的东西:
foo.example. 7200 IN SOA ns1.example.com. hostmaster.example.com. 1 3600 1800 2419200 7200 foo.example. 7200 IN NS ns1.example.com. foo.example. 7200 IN NS ns2.example.com. ...
除了所需的特定数据外,您还需要将这些必填logging添加到您的区域。
正如Michael所指出的, 2.8.4.3.3.0.7.1.e164.arpa是一个更可能的区域名称(即+1 703 348 2 )。
在PowerDNS的特定术语中,如果你直接在SQL中工作(这不一定是理想的),那么添加这个区域就像这样:
INSERT INTO domains (name, type) VALUES('2.8.4.3.3.0.7.1.e164.arpa', 'MASTER'); INSERT INTO records (domain_id, name, ttl, type, content) VALUES(7, '2.8.4.3.3.0.7.1.e164.arpa', 7200, 'SOA', 'ns1.example.com hostmaster.example.com 1 3600 1800 2419200 7200'); INSERT INTO records (domain_id, name, ttl, type, content) VALUES(7, '2.8.4.3.3.0.7.1.e164.arpa', 7200, 'NS', 'ns1.example.com'); INSERT INTO records (domain_id, name, ttl, type, content) VALUES(7, '2.8.4.3.3.0.7.1.e164.arpa', 7200, 'NS', 'ns2.example.com');
之后,您将添加您的NAPTRlogging:
INSERT INTO records (domain_id, name, ttl, type, content) VALUES(7, '0.1.9.2.8.4.3.3.0.7.1.e164.arpa', 7200, 'NAPTR', '...'); ...