Container uses 8.8.8.8 for DNS resolution
Author: BradStatonCreated Jun 3, 2026Updated Aug 9, 2026
Description
The container's /etc/resolv.conf has Google's Public DNS (8.8.8.8) hard-coded for DNS resolution. This prevents the container from using DNS resolvers on the local network (or, in my case in a k8s cluster) from being used.
Steps to recreate
- Open a shell in the container
- Run an
nslookupcommand - Results show that nameserver at
8.8.8.8is being used for resolution
/app # nslookup www.example.com
Server: 8.8.8.8
Address: 8.8.8.8:53
Non-authoritative answer:
Name: www.example.com
Address: 172.66.147.243
Name: www.example.com
Address: 104.20.23.154
Non-authoritative answer:
Name: www.example.com
Address: 2606:4700:10::6814:179a
Name: www.example.com
Address: 2606:4700:10::ac42:93f3Expected results
Container should use Docker host's or k8s cluster's DNS config.
Source: aceberg/WatchYourLAN