[FEAT] environment variable(s) to override DNS servers (essential in host network mode, e.g. TrueNAS Apps + Pi-hole setups)

オープン
#330 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
51/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker
領域
devops

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

enhancement
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

主要言語
Dockerfile
スター
743
フォーク
206
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

DevOps の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。