Skip to content

Update dnscrypt-proxy.md to fix systemctl editing and adding systemd-resolved optional support#1335

Open
JerbAcuch wants to merge 1 commit intopi-hole:masterfrom
JerbAcuch:patch-1
Open

Update dnscrypt-proxy.md to fix systemctl editing and adding systemd-resolved optional support#1335
JerbAcuch wants to merge 1 commit intopi-hole:masterfrom
JerbAcuch:patch-1

Conversation

@JerbAcuch
Copy link

Guide had manual editing of a systemctl service (socket) file instead of the designed systemctl edit override method. Implemented the systemctl edit method.

Also added a new (optional) section on setting the pihole to itself as a DNS resolver, and configuring systemd-resolved to work at the same time in case the pihole is not functioning / race condition on start.

Thank you for your contribution to the Pi-hole Community!

Please read the comments below to help us consider your Pull Request.

We are all volunteers and completing the process outlined will help us review your commits quicker.

Please make sure you

  1. Base your code and PRs against the repositories developmental branch.
  2. Sign Off all commits as we enforce the DCO for all contributions
  3. Sign all your commits as they must have verified signatures
  4. File a pull request for any change that requires changes to our documentation at our documentation repo

What does this PR aim to accomplish?:

Better aligned systemctl service (socket) modification with how the system is expected to modify these files. Current method would break when the maintainer updated the file and the user would have to re-implement the fix from this guide. Using the systemctl edit override method, this is much less likely.

Added an optional section on dual-configuration of systemd-resolved and pihole, including the pihole configuring itself as a primary DNS for self-logging and using systemctl-resolved as a backup/guarantee in case the worst should happen to FTLDNS

How does this PR accomplish the above?:

Lots of effort with two piholes at home and documenting configuration changes.


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

…resolved optional support

Guide had manual editing of a systemctl service (socket) file instead of the designed `systemctl edit` override method.  Implemented the `systemctl edit` method.

Also added a new (optional) section on setting the pihole to itself as a DNS resolver, and configuring systemd-resolved to work at the same time in case the pihole is not functioning / race condition on start. 

Signed-off-by: JerbAcuch <113802182+JerbAcuch@users.noreply.github.com>
@JerbAcuch JerbAcuch requested a review from a team as a code owner January 28, 2026 09:28
@netlify
Copy link

netlify bot commented Jan 28, 2026

Deploy Preview for pihole-docs ready!

Name Link
🔨 Latest commit 4ca229a
🔍 Latest deploy log https://app.netlify.com/projects/pihole-docs/deploys/6979d6dc12376800083bf19a
😎 Deploy Preview https://deploy-preview-1335--pihole-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

The following settings in `/usr/lib/systemd/system/dnscrypt-proxy.socket`, let `dnscrypt-proxy` listen on localhost on port 5053:
```bash
sudo systemctl edit dnscrypt-proxy.socket
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add blank line after ```

Suggested change
```
```


#### Pihole bind restrictions

Pihole must not bind to `0.0.0.0:53` so that `dnscrypt-proxy.socket` may also bind on port 53, as systemd-resolved is unable to use DNS servers with non-standard ports and `/etc/resolv.conf` has this restriction as well. Configure `pihole-FTL` to bind to a specific interface. The interface is the identifier given by the network manager. For netplan, you may use `sudo netplan status` to view all the connections and the names.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing space:

Suggested change
Pihole must not bind to `0.0.0.0:53` so that `dnscrypt-proxy.socket` may also bind on port 53, as systemd-resolved is unable to use DNS servers with non-standard ports and `/etc/resolv.conf` has this restriction as well. Configure `pihole-FTL` to bind to a specific interface. The interface is the identifier given by the network manager. For netplan, you may use `sudo netplan status` to view all the connections and the names.
Pihole must not bind to `0.0.0.0:53` so that `dnscrypt-proxy.socket` may also bind on port 53, as systemd-resolved is unable to use DNS servers with non-standard ports and `/etc/resolv.conf` has this restriction as well. Configure `pihole-FTL` to bind to a specific interface. The interface is the identifier given by the network manager. For netplan, you may use `sudo netplan status` to view all the connections and the names.

sudo netstat -lvnp | grep pihole-FTL | grep :53
```

### Further modify `dnscrypt-proxy.socket`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a blank line after a heading:

Suggested change
### Further modify `dnscrypt-proxy.socket`
### Further modify `dnscrypt-proxy.socket`

sudo systemctl restart dnscrypt-proxy.service
```

#### `systemd-resolved` configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a blank line after a heading:

Suggested change
#### `systemd-resolved` configuration
#### `systemd-resolved` configuration

@yubiuser
Copy link
Member

Thanks for your PR. Part of the information you wanted to add has been implemented already by #1343

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants