这是我的区域文件:
$TTL 1H
@ IN SOA ns.e164.arpa. hostmaster.e164.arpa. (
199802151 ; serial, todays date + todays serial #
8H ; refresh, seconds
2H ; retry, seconds
4W ; expire, seconds
1D ) ; minimum, seconds
;
NS ns ; Inet Address of name server
;
;
2.8.0.2.0.8.0.0.8.5.6.1.9.4.e164.arpa. NAPTR 0 0 "u" "E2U+sip" "!^.*$!sip:+49165800802082@ibcf.core.test;user=phone!" .
2.8.0.2.0.8.0.0.8.5.6.1.9.4.e164.arpa. NAPTR 0 0 "u" "E2U+sip" "!^.*$!sip:+49165800802082@ibcf.core.test!" .
3.2.1.0.5.5.5.5.1.2.1.e164.arpa. NAPTR 0 0 "u" "E2U+pstn:tel" "!^.*$!tel:+1-215-555-0123;npdi;rn=+1-215-555-0199!" .
3.2.1.0.5.5.5.5.1.2.1.e164.arpa. NAPTR 10 100 "u" "E2U+pstn:sip" "!^.*$!sip:+1-215-555-0123;npdi;rn=+1-215-555-0199@ibcf.core.test;user=phone!".
;
;
; A records:
;
ns A 10.10.240.4
localhost A 127.0.0.1
ns AAAA 3001:10:240::4
然后我运行:
dig naptr 3.2.1.0.5.5.5.5.1.2.1.e164.arpa @127.0.0.1
它工作正常,结果是:
; <<>> DiG 9.9.4-P2 <<>> naptr 3.2.1.0.5.5.5.5.1.2.1.e164.arpa @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40018
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 3
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;3.2.1.0.5.5.5.5.1.2.1.e164.arpa. IN NAPTR
;; ANSWER SECTION:
3.2.1.0.5.5.5.5.1.2.1.e164.arpa. 3600 IN NAPTR 10 100 "u" "E2U+pstn:sip" "!^.*$!sip:+1-215-555-0123\;npdi\;rn=+1-215-555-0199@ibcf.core.test\;user=phone!" .
3.2.1.0.5.5.5.5.1.2.1.e164.arpa. 3600 IN NAPTR 0 0 "u" "E2U+pstn:tel" "!^.*$!tel:+1-215-555-0123\;npdi\;rn=+1-215-555-0199!" .
;; AUTHORITY SECTION:
e164.arpa. 3600 IN NS ns.e164.arpa.
;; ADDITIONAL SECTION:
ns.e164.arpa. 3600 IN A 10.10.240.4
ns.e164.arpa. 3600 IN AAAA 3001:10:240::4
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Sep 19 10:42:20 CEST 2016
;; MSG SIZE rcvd: 313
我的问题:
我有很多像 ( 3.2.1.0.5.5.5.5.1.2.1.e164.arpa.
) 这样的地址要查找,但我不想在这个区域文件中写入每条记录。
dns 是否支持区域配置文件的正则表达式?就像:
3.*.e164.arpa. NAPTR 10 100 "u" "E2U+pstn:sip" "!^.*$!sip:+1-215-555-0123;npdi;rn=+1-215-555-0199@ibcf.core.test;user=phone!".
第一个字符3
将匹配此规则。