mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
How to set DNS-server and/or hosts file in docker #1332
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#1332
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HolgerAusB on GitHub (Aug 13, 2022).
⚠️ Please verify that this bug has NOT been raised before.
🛡️ 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:1234and 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:1234and 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
@HolgerAusB commented on GitHub (Aug 13, 2022):
I was just on the search for a JSON viewer and tested that with an kuma backup. There allready is a data field for the resolver in each monitor, but how can I edit this in kuma? Or do I need to manipulate that backup and upload this to kuma? will this be persistant?
@nbvcxz commented on GitHub (Aug 13, 2022):
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.@HolgerAusB commented on GitHub (Aug 13, 2022):
Thank you @nbvcxz that helped. But I think there shouldd be a (per monitor) option to set the resolver in kuma.
I have added a
--dns 192.168.0.1to the run command. Now the monitor works with domain name. Nevertheless in a new backup the resolver-line is unchanged at 1.1.1.1@lnxbil commented on GitHub (Aug 21, 2022):
Normally the container inherits the dns settings of the client (more precisely the internal docker dns server gets it's resolvers from
/etc/resolv.confwhen it starts), so it should work as it was intended and it also works for me exactly like I described. I just had the same problem and solved it by editing the docker host/etc/resolv.conf.@github-actions[bot] commented on GitHub (Nov 19, 2022):
We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.
@github-actions[bot] commented on GitHub (Nov 22, 2022):
This issue was closed because it has been stalled for 2 days with no activity.