[PR #28] [MERGED] Use host DNS for LXC container resolv.conf #29

Closed
opened 2026-10-15 12:51:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/LXC2Docker/pull/28
Author: @JBailes
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @JBailes

Base: main ← Head: fix/container-dns-from-host


📝 Commits (1)

  • fcc6560 fix: use host DNS for containers

📊 Changes

2 files changed (+110 additions, -4 deletions)

View changed files

📝 internal/lxc/manager.go (+67 -4)
📝 internal/lxc/manager_test.go (+43 -0)

📄 Description

Summary

  • use non-loopback host nameservers for default container resolv.conf instead of hardcoding public DNS
  • prefer /run/systemd/resolve/resolv.conf so systemd-resolved hosts pass uplink DNS into containers
  • keep explicit Docker HostConfig DNS values authoritative

Context

SmoothNAS self-hosted runner containers intermittently failed GitHub jobs with DNS/connect timeouts. The host uses 192.168.1.1 as uplink DNS, while generated runner containers had 8.8.8.8/1.1.1.1.

Tests

  • gofmt
  • go test ./internal/lxc (blocked locally: missing lxc.pc/pkg-config dependency)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/LXC2Docker/pull/28 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 5/17/2026 **Status:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `main` ← **Head:** `fix/container-dns-from-host` --- ### 📝 Commits (1) - [`fcc6560`](https://github.com/games-on-whales/LXC2Docker/commit/fcc656015f37c5e40023161172d13ef43dcd01fb) fix: use host DNS for containers ### 📊 Changes **2 files changed** (+110 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `internal/lxc/manager.go` (+67 -4) 📝 `internal/lxc/manager_test.go` (+43 -0) </details> ### 📄 Description ## Summary - use non-loopback host nameservers for default container resolv.conf instead of hardcoding public DNS - prefer /run/systemd/resolve/resolv.conf so systemd-resolved hosts pass uplink DNS into containers - keep explicit Docker HostConfig DNS values authoritative ## Context SmoothNAS self-hosted runner containers intermittently failed GitHub jobs with DNS/connect timeouts. The host uses 192.168.1.1 as uplink DNS, while generated runner containers had 8.8.8.8/1.1.1.1. ## Tests - gofmt - go test ./internal/lxc (blocked locally: missing lxc.pc/pkg-config dependency) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/LXC2Docker#29
No description provided.