How to set DNS-server and/or hosts file in docker
See original GitHub issue⚠️ Please verify that this bug has NOT been raised before.
- I checked and didn’t find similar issue
🛡️ Security Policy
- I agree to have read this project Security Policy
📝 Describe your problem
I am quite new to docker and kuma. I tried to monitor a local https server by name https://sub1.example.com:1234 and it lasts me hours until I realized that kuma never got an ip of that server. The Raspi got its addresses from pihole, which would deliver back a local IP for that host name. But as kuma is in a container, there is a different dns server setting in the container which asks a dns server outside the local net. But as my https-server sub1 is not reachable from the internet, the check fails.
So, is it possible somehow to set the dns server setting inside the docker container (or as new feature in kuma)? And/or is there a way to set a hosts file with static name>ip ?
Meanwhile I set the monitor to https://192.168.1.23:1234 and ckecked ‘ignore TLS/SSL-errors’.
This issue might similar to #1302
🐻 Uptime-Kuma Version
1.17.1
💻 Operating System and Arch
Raspbian Bullseye
🌐 Browser
Firefox latest/stable for Windows 11
🐋 Docker Version
20.10.17, build 100c701
🟩 NodeJS Version
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6

Top Related StackOverflow Question
As far as I understand, you need: https://docs.docker.com/config/containers/container-networking/#dns-services or https://docs.docker.com/engine/reference/commandline/run/#add-entries-to-container-hosts-file---add-host Not Uptime-Kuma specific. You just need to add appropriate parameter to your
docker runor compose file.This issue was closed because it has been stalled for 2 days with no activity.