Commit cb1eb9
2026-01-19 20:29:32 mb tech: pi-hole update| /dev/null .. ubuntu host preparation for pi-hole (port 53 conflict fix).md | |
| @@ 0,0 1,72 @@ | |
| + | # Ubuntu Host Preparation for Pi-hole (Port 53 Conflict Fix) |
| + | |
| + | Here is the information formatted as a clean Markdown file, ready to be saved or pushed to a repository. |
| + | |
| + | ```markdown |
| + | # Ubuntu Host Preparation for Pi-hole (Port 53 Conflict Fix) |
| + | |
| + | ## 1. The Issue: Port 53 Conflict |
| + | By default, Ubuntu runs `systemd-resolved`, which acts as a local DNS stub listener on **Port 53**. Pi-hole also requires Port 53 to function as a DNS server. If `systemd-resolved` is not modified, the Pi-hole container will fail to start with an "address already in use" error. |
| + | |
| + | ## 2. The Fix: Steps to Release Port 53 |
| + | |
| + | ### Step 1: Disable the DNS Stub Listener |
| + | 1. Open the resolved configuration file: |
| + | ```bash |
| + | sudo nano /etc/systemd/resolved.conf |
| + | |
| + | ``` |
| + | |
| + | 2. Locate the line `#DNSStubListener=yes`. |
| + | 3. Change it to: |
| + | ```ini |
| + | DNSStubListener=no |
| + | |
| + | ``` |
| + | |
| + | |
| + | 4. Save and exit (`Ctrl+O`, `Enter`, `Ctrl+X`). |
| + | |
| + | ### Step 2: Fix Local DNS Resolution |
| + | |
| + | Since the stub listener is disabled, the default `127.0.0.53` DNS entry will no longer work. Point the system to the upstream DNS file instead so the host maintains internet connectivity. |
| + | |
| + | 1. Remove the existing symlink: |
| + | ```bash |
| + | sudo rm /etc/resolv.conf |
| + | |
| + | ``` |
| + | |
| + | |
| + | 2. Create a new symlink to the actual resolv file: |
| + | ```bash |
| + | sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf |
| + | |
| + | ``` |
| + | |
| + | |
| + | |
| + | ### Step 3: Reload and Restart Services |
| + | |
| + | Apply the changes and reload the daemon to clear any configuration warnings. |
| + | |
| + | ```bash |
| + | sudo systemctl daemon-reload |
| + | sudo systemctl restart systemd-resolved |
| + | |
| + | ``` |
| + | |
| + | ### Verification |
| + | |
| + | Check if Port 53 is free (output should be empty or not show `systemd-resolved`): |
| + | |
| + | ```bash |
| + | sudo lsof -i :53 |
| + | |
| + | ``` |
| + | |
| + | ``` |
| + | |
| + | Would you like me to create a `docker-compose.yml` template for Pi-hole to go along with this? |
| + | |
| + | ``` |
