Skip to content

How to setup DNS over HTTPS systemwide?

Hello,

how can I setup DNS over HTTPS and DNSSEC systemwide?

​

I already tried it with dnscrypt-proxy, but it did not work.Not sure if it is enough to specify a server name in the config file and start the service.

I am also using NetworkManager.

​

Thank you!

4 points13 comments
Open on Reddit
About this post
Posted
Archived
Score
4 · 100% up
Kind
Text
ID
jsiqpi

Author

8
posts
47
comments
0
media
View profile

16 comments

dnscrypt-proxy is your best bet and it's super simple to setup by following the official guide they provide. but for a summary

  1. your config is in /etc/dnscrypt-proxy/dnscrypt-proxy.toml
  2. uncomment the server_names* line and pick a server either from the built in ones or from here, care to pick a DoH server and not Dnscrypt if that's what you want.
  3. change "require_dnssec" to true
  4. you gonna need to change your dns settings by editing /etc/resolv.conf to the following nameserver 127.0.0.1 options edns0
  5. now test if it's wokring, dnscrypt-proxy -resolve example.com
  6. no errors? or slow resolving? enable the service, systemctl enable --now dnscrypt-proxy.service
  7. found errors? or the server didn't resolve the site? try another server from the link in the second step and try again.
  8. make /etc/resolv.conf unwritable so it doesn't get changed by anything, chattr +i /etc/resolv.conf
2 points
unknown author5 hidden

Deleted before we saved it.

1 points

well that's a 4 month old edit lol, uncomment server_names not listen_addresses.

For the servers list, you take the name of the server not the sdns, for example when I open the link I put in my comment, there's a server called "a-and-a", put the name in the server_names so it be like this (if you only want to use the server you chose)

server_names = ['a-and-a']

Or like this (and dnscrypt is going to pick the fastest server)

server_names = ['a-and-a', 'google', 'cloudflare']

optional but recommended, set "require_dnssec" to true

2 points

Thank you very much, it worked.
I were missing step number 4, when I tried it on my own.

Do you maybe know how to setup eSNI systemwide, too? I could not find any resources for that.

​

An addition to step number 8:
If you use, NetworkManager it will tell your system to use the dns which it gets from the routers dhcp server. NetworkManager will clear your /etc/resolv.conf file.

To stop this, go to /etc/NetworkManager/conf.d/ and add a file (example: dns.conf).
Write this in that file:
[main]
dns=none

1 points

ESNI is currently only a draft nothing official yet, If you need it firefox had it for a while now behind a flag, if you have a lot of censorship in your country you could instead use a vpn or tor.

That's why we make reslov.conf unwritable so mostly NetworkManager doesn't modify it.

2 points

Is there an easy way to check if it is working? For example on a website?

I want to see if my windows virtual machine is using that, too.

1 points

Is there an easy way to check if it is working?

systemctl status dnscrypt-proxy.service or get bind-tools and do nslookup on any domain.

For windows I believe you need to setup your dns settings to 127.0.0.1 and 9.9.9.9 (primary and secondary) and you can check if the service is running in (Services) You can change the quad9 servers to any other in the dnscrypt config.

2 points

systemd-resolved supports DNS over TLS if that would work for you

2 points

I already use that, but need DoH for using public wifi spots.

1 points

This one? Might want to check the github to see if additional config required after install.

https://www.archlinux.org/packages/community/x86_64/dns-over-https/

​

Also dns over https not on by default. SMH

1 points

Unfortunately, that package uses only Google and Cloudfare servers.

2 points

Straight from the github repo for that package I linked:

Client and server software to query DNS over HTTPS, using Google DNS-over-HTTPS protocol and IETF DNS-over-HTTPS (RFC 8484).

​

By default, Google DNS over HTTPS is used. It should work for most users (except for People's Republic of China). If you need to modify the default settings, type: ``sudoedit /etc/dns-over-https/doh-client.conf\

https://github.com/m13253/dns-over-https

You can most definitely point this at any DNS server you like and are in no way required to use google/cloudflare. It also is DNSSEC compatible and discusses how to use DNSSEC.

​

It doesn't look like the setup is easy if you need hand holding the whole way through, but you can certainly use this to achieve what you need. /u/-Waliullah

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.