louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.3k stars 5.39k forks source link

DNS-over-TCP seems to not be supported, bricks HTTP(s) monitors #5321

Open skedastically opened 2 weeks ago

skedastically commented 2 weeks ago

πŸ“‘ I have found these related issues/pull requests

.

πŸ›‘οΈ Security Policy

Description

When configuring DNS over TCP using the options use-vc option, Uptime Kuma fails to resolve any domains and red out on all HTTP(s) monitors. This seems to be caused by DNS over TCP not being supported by Uptime Kuma.

πŸ‘Ÿ Reproduction steps

  1. Configure /etc/resolv.conf on host as follows:
options use-vc
nameserver 9.9.9.9
  1. Start Uptime Kuma

Container's /etc/resolv.conf:

$ podman exec uptime-kuma cat /etc/resolv.conf
search dns.podman
nameserver 192.168.80.1
nameserver fdfc:3c2c:255c:c286::1
options use-vc

πŸ‘€ Expected behavior

DNS will resolve normally and Uptime Kuma works as before.

πŸ˜“ Actual Behavior

The following was logged. Same errors also shown on web UI.

<datetime> [MONITOR] WARN: Monitor #27 'Test': Failing: getaddrinfo EAI_AGAIN example.org | Interval: 60 seconds | Type: http | Down Count: 0 | Resend Interval: 0

The following commands inside the container also fails:

$ podman exec -it uptime-kuma bash
node@uptime-kuma:/app$ curl example.org
curl: (6) Could not resolve host: example.org

Peculiarly, curl works when IPv4 or IPv6 is specified:

node@uptime-kuma:/app$ curl -4 example.org
<website stuff>
node@uptime-kuma:/app$ curl -6 example.org
<website stuff>

🐻 Uptime-Kuma Version

1.23.15

πŸ’» Operating System and Arch

Linux aarch64

🌐 Browser

Firefox

πŸ–₯️ Deployment Environment

πŸ“ Relevant log output

No response

skedastically commented 2 weeks ago

Workaround

Use a different --dns-option in the container to disable forcing TCP queries. For me an empty comment (#) to be inserted into options would works fine.

podman-compose.yml:

services:
 uptime-kuma:
    ...
    dns_opt: ["#"]
$ podman exec uptime-kuma cat /etc/resolv.conf
search dns.podman
nameserver 192.168.80.1
nameserver fdfc:3c2c:255c:c286::1
options #
louislam commented 2 weeks ago

The following commands inside the container also fails:

If it is also failed inside the container, it is probably a Docker issue. Change it to the help tag.