Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the instructions to free up port 53 in Fedora #1660

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Here is a rundown of other arguments for your docker-compose / docker run.
- Docker's default network mode `bridge` isolates the container from the host's network. This is a more secure setting, but requires setting the Pi-hole DNS option for _Interface listening behavior_ to "Listen on all interfaces, permit all origins".
- If you're using a Red Hat based distribution with an SELinux Enforcing policy, add `:z` to line with volumes.

### Installing on Ubuntu or Fedora
## Installing on Ubuntu or Debian
OptimoSupreme marked this conversation as resolved.
Show resolved Hide resolved

Modern releases of Ubuntu (17.10+) and Fedora (33+) include [`systemd-resolved`](http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html) which is configured by default to implement a caching DNS stub resolver. This will prevent pi-hole from listening on port 53.
The stub resolver should be disabled with: `sudo sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf`.
Expand Down Expand Up @@ -193,6 +193,24 @@ If you choose to disable the service, you will need to manually set the nameserv

Users of older Ubuntu releases (circa 17.04) will need to disable dnsmasq.

## Installing on Fedora
Modern releases of Fedora (33+) include systemd-resolved, which is configured by default to implement a caching DNS stub resolver. This may conflict with Pi-hole's DNS server by preventing it from listening on port 53. To avoid this conflict, you need to disable the DNS stub resolver.
Disable the DNS Stub Resolver

Run the following commands to free port 53 and allow pihole to run:
1. Ensure the directory /etc/systemd/resolved.conf.d exists.
2. Create a configuration file (/etc/systemd/resolved.conf.d/10-pihole.conf) to override the default settings.
3. Add the DNSStubListener=no directive, which disables the local DNS stub listener.
4. Restart `systemd-resolved` to apply the new configuration.
```
[ -d /etc/systemd/resolved.conf.d ] || sudo mkdir /etc/systemd/resolved.conf.d
echo '[Resolve]' | sudo tee /etc/systemd/resolved.conf.d/10-pihole.conf
echo 'DNSStubListener=no' | sudo tee -a /etc/systemd/resolved.conf.d/10-pihole.conf
sudo systemctl restart systemd-resolved
```

Note that by default in Fedora, `/etc/resolv.conf` already points to `/run/systemd/resolve/resolv.conf`, so DNS resolution continues to work even when the stub listener is disabled.

## Installing on Dokku

[@Rikj000](https://github.com/Rikj000/) has produced a guide to assist users [installing Pi-hole on Dokku](https://github.com/Rikj000/Pihole-Dokku-Installation).
Expand Down