我有以下的领事配置。
{
"service": {
"name": "pihole",
"Address": "192.168.0.15",
"tags": [
"pi"
],
"port": 8165,
"check": {
"args": [
"curl",
"192.168.0.15"
],
"interval": "10s"
}
}
}使用dig我现在没有得到任何错误,
$ dig @127.0.0.1 -p 8600 pihole.service.consul
; <<>> DiG 9.9.7-P3 <<>> @127.0.0.1 -p 8600 pihole.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63573
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pihole.service.consul. IN A
;; ANSWER SECTION:
pihole.service.consul. 0 IN A 192.168.0.15
;; Query time: 0 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Sun Aug 30 23:02:34 BST 2020
;; MSG SIZE rcvd: 66但是当我执行nslookup时,我得到了错误server can't find pihole.service.consul: NXDOMAIN
$ nslookup pihole.service.consul
Server: 192.168.0.15
Address: 192.168.0.15#53
** server can't find pihole.service.consul: NXDOMAIN实际上,我在这个ip地址192.168.0.15上运行了一个pihole,因为领事健康检查正在通过。
2020-08-30T23:10:58.707+0100 [DEBUG] agent: Check status updated: check=service:pihole status=passing发布于 2020-08-31 07:49:55
在命令dig @127.0.0.1 -p 8600 pihole.service.consul中,您显式地指示host使用服务器127.0.0.1和端口8600。
默认情况下,Nslookup使用/etc/resolv.conf文件中的名称服务器和端口53。
你可以试试
nslookup pihole.service.consul 127.0.0.1 -port=8600https://stackoverflow.com/questions/63662633
复制相似问题