![kubesphere2.1.1容器内部无法解析本地dns解析,容器内部手动添加nameserver到resolv.conf,然后ping域名的时候还是会出现无法解析的问题,如下:
/home # ping testafcgateway03.518dai.com
PING testafcgateway03.518dai.com (192.168.0.236): 56 data bytes
64 bytes from 192.168.0.236: seq=0 ttl=63 time=0.222 ms
64 bytes from 192.168.0.236: seq=1 ttl=63 time=0.335 ms
C
— testafcgateway03.518dai.com ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.222/0.278/0.335 ms
/home # ping testafcgateway03.518dai.com
ping: bad address ‘testafcgateway03.518dai.com’
/home # ping testafcgateway03.518dai.com
ping: bad address ‘testafcgateway03.518dai.com’
/home # ping testafcgateway03.518dai.com
ping: bad address ‘testafcgateway03.518dai.com’
/home # ping testafcgateway03.518dai.com
ping: bad address ‘testafcgateway03.518dai.com’
/home # cat /etc/resolv.conf
nameserver 169.254.25.10
search ecm-2.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
nameserver 192.168.0.236
nameserver 114.114.114.114
/home # ping testafcgateway03.518dai.com
PING testafcgateway03.518dai.com (192.168.0.236): 56 data bytes
64 bytes from 192.168.0.236: seq=0 ttl=63 time=0.268 ms
64 bytes from 192.168.0.236: seq=1 ttl=63 time=2.326 ms
64 bytes from 192.168.0.236: seq=2 ttl=63 time=0.284 ms
C
— testafcgateway03.518dai.com ping statistics —
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.268/0.959/2.326 ms
/home #