[FEAT] environment variable(s) to override DNS servers (essential in host network mode, e.g. TrueNAS Apps + Pi-hole setups)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 51/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker
- Lĩnh vực
- devops
Hướng nghiên cứu
Read the container init scripts that currently configure /etc/resolv.conf and compare their environment variable handling with the WHITELIST and HOST_WHITELIST pattern referenced in issues #146 and #141. Identify how startup preserves current behavior when the new variables are unset, then add coverage for the configured and unset cases. Done means the requested DNS values are applied before the service starts and existing behavior remains unchanged when they are absent.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is this a new feature request?
- I have searched the existing issues
Wanted change
Add support for one or two environment variables that override the DNS servers of the container, applied by the init system before the service starts:
DNS_SERVERS=192.168.1.1,1.1.1.1 # comma-separated list of nameservers
DNS_OPTIONS=attempts:2 timeout:2 # optional extra resolv.conf options
When set, the init writes /etc/resolv.conf with these values. When unset, behavior stays exactly as today (fully backward-compatible).
This follows the same pattern as the previously accepted WHITELIST / HOST_WHITELIST env vars (#146, #141).
Reason for change
The app is commonly deployed through GUI-based app managers (TrueNAS SCALE Apps / iX Apps), where the template uses network_mode: host and users have no access to docker run / compose options like --dns.
A very common home-lab pattern on such hosts is a network-wide filtering/validating resolver (Pi-hole with DNSSEC) on the same machine, used by every host and container. This is desirable for everything except a torrent client: Transmission resolves dozens of tracker domains on every announce (every ~30 min per tracker), many of them dead or with broken DNSSEC signatures, generating constant retries. A single torrent client ends up flooding the resolver's statistics and logs, drowning out all other devices in the dashboard.
Routing only Transmission to another resolver (e.g. the ISP box) while the rest of the host keeps the local resolver requires overwriting /etc/resolv.conf inside the container at every start. Today this needs an undocumented, fragile hand-made init script, impossible to configure from the TrueNAS app GUI.
With --network host, Docker itself ignores --dns, so there is no native Docker mechanism to give this one container different DNS servers. An env var is the only clean way for GUI users.
The same need applies to other LSIO images commonly run in host mode through app managers (qBittorrent, Deluge, SABnzbd...), so a generic implementation would benefit the whole fleet.
Proposed code change
No response
- Ngôn ngữ chính
- Dockerfile
- Star
- 743
- Fork
- 206
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
soroswap/token-list#125 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nekko-labs/nekko-agent#2998 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
francescopace/espectre#222 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
good first issue ops security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Kyvera-Labs/verixa#565 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày