AdguardTeam / AdguardTeam/AdGuardHome

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

Đang mở
#8,281 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
feature request
Ngôn ngữ chính
TypeScript
Star
36.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.