AdguardTeam / AdguardTeam/AdGuardHome

bind dns address/port optionally, no fatal error when at least one bind address works

Abierto
#8,281 2 comentarios 0 reacciones 0 asignados Ver en GitHub
feature request
Lenguaje dominante
TypeScript
Estrellas
36.9k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Prerequisites

- [x] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) and found no answer

- [x] I have searched other issues and found no duplicates

- [x] I want to request a feature or enhancement and not ask a question

### The problem
while at least one address:port can be bound, another one isn't AdguardHome exits with fatal error. please let's lazy-load it once it become available.

```log
...
AdGuardHome[1430]: 2026/03/05 19:08:28.994482 [info] dnsproxy: starting dns proxy server
AdGuardHome[1430]: 2026/03/05 19:08:28.994757 [info] dnsproxy: creating udp server socket addr=127.0.0.1:53
AdGuardHome[1430]: 2026/03/05 19:08:28.995267 [info] dnsproxy: listening to udp addr=127.0.0.1:53
AdGuardHome[1430]: 2026/03/05 19:08:28.995295 [info] dnsproxy: creating udp server socket addr=[::1]:53
AdGuardHome[1430]: 2026/03/05 19:08:28.995376 [info] dnsproxy: listening to udp addr=[::1]:53
AdGuardHome[1430]: 2026/03/05 19:08:28.995395 [info] dnsproxy: creating udp server socket addr=172.17.0.1:53
AdGuardHome[1430]: 2026/03/05 19:08:28.995469 [info] dnsproxy: warning: binding attempt=1 err="listen udp 172.17.0.1:53: bind: cannot assign requested address"
AdGuardHome[1430]: 2026/03/05 19:08:29.019288 [error] closing query log: flushing log buffer: nothing to write to a file
AdGuardHome[1430]: 2026/03/05 19:08:29.024189 [fatal] starting dns server: configuring listeners: listening on udp addr 172.17.0.1:53: listening to udp socket: li>
systemd[1]: adguardhome.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: adguardhome.service: Failed with result 'exit-code'.
```

```yaml
http:
address: 127.0.0.1:3080
session_ttl: 720h
dns:
bind_hosts:
- 127.0.0.1
- ::1
- 172.17.0.1
port: 53
...
```

### Proposed solution

* keep warning about failed to bind address/port
* no fatal error when at least one address/port bound successfully

to keep compatibility for users who consider one of many address bound error is critical, let's create yet another key:value list in config file.
```yaml
dns:
bind_hosts_nonfatal:
- [::1]:53
- 192.168.99.87:1553
```

### Alternatives considered and additional information

current workaround, in systemd service preexec script-checker and editor:
- check `ip -br a` for existing interfaces/addresses
- check port is free
- exclude from config unbindable addresses

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.