Allow specifying DNS check "resolver server" by hostname

This issue has been tracked since 2022-11-18.

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

UI Feature

🔖 Feature description

I know it sounds weird, but it makes a lot of sense for dockerized setups. I have both uptime kuma and pihole running in containers, and I would like to have uptime kuma check pihole.

The first issue is that the local IP of the host machine which is mapped to the pihole container isn't available to the uptime kuma container, which I have made accessible using traefik. I solved this and other container reachability issues using the standard docker method of creating an external network, I called "healthcheck" that I add to uptime kuma and all containers I want to check.

The issue is that, once all relevant containers are in the "healthcheck" network, they can access each other using the docker-compose service name, which is automatically resolved to an IP address. For example, since my pihole container is just called "pihole" in my docker compose, I can ping "pihole" from inside my uptime kuma container like so:

[email protected]:/app# ping pihole
PING pihole ( 56(84) bytes of data.
64 bytes from pihole.healthcheck ( icmp_seq=1 ttl=64 time=0.142 ms
--- pihole ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.142/0.142/0.142/0.000 ms

I can also add an uptime kuma DNS check using the pihole IP address directly ( and that works as expected, though that IP is not guaranteed to be stable.

✔️ Solution

The solution would be to allow specifying a hostname for the resolver server, that way I could specify the pihole hostname. It could be resolved at check time and cause the check to fail if it cannot be resolved. That would allow us to use container hostname networking to do checks on DNS servers running in separate containers


I'm not sure what workarounds are possible - maybe using host networking on uptime kuma and/or the pihole container would work but I haven't tried that. For now I specified the container IP directly and will just update it when it changes.

📝 Additional Context

Below you can also see that dig from inside the uptime kuma container to the LAN ip of the docker host fails with reply from unexpected source, but digging to the hostname @pihole succeeds - it would be nice for uptime kuma to similarly be able to take a hostname that can be resolved to the correct container IP:

[email protected]:/# dig @
;; reply from unexpected source:, expected
;; reply from unexpected source:, expected
;; reply from unexpected source:, expected

; <<>> DiG 9.11.5-P4-5.1+deb10u8-Debian <<>> @
;; global options: +cmd
;; connection timed out; no servers could be reached
[email protected]:/# dig @pihole

; <<>> DiG 9.11.5-P4-5.1+deb10u8-Debian <<>> @pihole
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4528
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;			IN	A


;; Query time: 0 msec
;; WHEN: Fri Nov 18 05:54:25 UTC 2022
;; MSG SIZE  rcvd: 55
rezzorix wrote this answer on 2022-11-23
stephen304 wrote this answer on 2022-11-23

I think this could be helpful:

I'm not sure how that can help, I'm already publishing port 53 of my pihole container to the docker host as described there, and I can query it as you can see above. The issue is that uptime kuma fails to do a check against the ip of the host (maybe related to reply from unexpected source) while doing the same from a separate device on the network is successful (I'm using pihole for many devices so I know querying the host IP with the published port 53 is working). Additionally, the query from uptime kuma succeeds using the ephemeral container IP. Unless you are suggesting using the container hostname which is the part that fails because unlike dig, uptime kuma can't use a hostname as a resolver for a DNS check.

rezzorix wrote this answer on 2022-11-23

In general from your explanation it sounds like your network setup is a bit overcomplicated.
Therefore I most likely misunderstood your post at first.

So question:
Why wouldnt you give at least your pihole a fixed IP-address within your docker network?
That would solve all your issues and no other work-around needed, no?

More Details About Repo
Owner Name louislam
Repo Name uptime-kuma
Full Name louislam/uptime-kuma
Language JavaScript
Created Date 2021-07-03
Updated Date 2022-11-30
Star Count 23666
Watcher Count 159
Fork Count 1992
Issue Count 694


Issue Title Created Date Updated Date