AdguardTeam / AdguardTeam/AdGuardHome

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

未關閉
#8,281 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
feature request
主要語言
TypeScript
星號
36.9k
分支
2.5k
PR 合併指標
30 天內沒有已合併 PR

描述

### 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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。