`[root@test001 ~]# nslookup vault.service.consul
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: vault.service.consul
Address: 192.168.3.1
[root@test001 ~]# curl -I http://192.168.3.1:8200
HTTP/1.1 307 Temporary Redirect
Cache-Control: no-store
Content-Type: text/html; charset=utf-8
Location: /ui/
Date: Wed, 09 Jan 2019 02:57:26 GMT
`
`
[root@test001 ~]# ping vault.service.consul
ping: vault.service.consul: Name or service not known
[root@test001 ~]# curl -I http://vault.service.consul:8200
curl: (6) Could not resolve host: vault.service.consul; Name or service not known
`
[root@test-001 ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
[root@test001 ~]# consul version
Consul v1.4.0
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
"ports" : {
"dns" : 53
},
"dns_config" : {
"node_ttl" : "10s",
"service_ttl": {
"": "5s",
"vault": "10s"
},
"soa": {
"min_ttl" : 1
}
},
[root@test001 ~]# cat /etc/resolv.conf
options timeout:2 attempts:3 rotate single-request-reopen
; generated by /usr/sbin/dhclient-script
search node.consul. service.consul.
nameserver 127.0.0.1
nameserver 100.100.2.138
nameserver 100.100.2.136
[root@test001 ~]# grep '^hosts' /etc/nsswitch.conf
hosts: files dns myhostname
So,how to fix this?
how to fix ?
@limingyao remove single-request-reopen option from /etc/resolv.conf
Most helpful comment
@limingyao remove
single-request-reopenoption from /etc/resolv.conf