Skip to content

DNScrypt support #6244

@ghost

Description

The problem you're addressing (if any)
DNS resolving via DNScrypt.

Describe the solution you'd like
Run DNScrypt-proxy in firewall-vm and forward DNS-requests to that service.

Where is the value to a user, and who might that user be?
DNScrypt is a fast and reliable solution to encrypt and authenticate DNS traffic. Actually I would expect every operating system to protect DNS traffic. Protection of DNS traffic concerns all users of operating systems which utilise the internet. There are DoT and DoH also, but so far DNScrypt worked best for me.

Describe alternatives you've considered
I have not considered an alternative so far. I have tried DoT and DoH in different setups but their performance hasn't been convincing.

Additional context
This is just a quick hack. I'm interested in your perspective, especially if you have security concerns.

Relevant documentation you've consulted
https://www.qubes-os.org/doc/contributing/

Related, non-duplicate issues
#2341
#2344
https://github.com/DNSCrypt/dnscrypt-proxy
https://blog.tufarolo.eu/how-to-configure-pihole-in-qubesos-proxyvm/

To enable DNScrypt for Qubes-OS it takes two steps:

Step 1:

# start FEDORA-TEMPLATE-VM and run a terminal
sudo su
dnf install dnscrypt-proxy
# do not (!) enable the dnscrypt-proxy.service
# shutdown FEDORA-TEMPLATE-VM
# restart all VMs which use the FEDORA-TEMPLATE

Step 2:

# open a terminal in SYS-FIREWALL
sudo su
cd /rw/config
vi rc.local
# insert the lines below at the end of rc.local
# save and close file
# shutdown and restart SYS-FIREWALL
# start dnscrypt-proxy
systemctl start dnscrypt-proxy.service
# tweak iptables
iptables -t nat -F PR-QBS
iptables -t nat -I PR-QBS -i vif+ -p udp --dport 53 -j DNAT --to-destination 127.0.0.1
iptables -I INPUT -i vif+ -p udp --dport 53 -d 127.0.0.1 -j ACCEPT
# enable traffic coming from the virtual interfaces to be forwarded to the loopback interface
find /proc/sys/net/ipv4/conf -name "vif*" -exec bash -c 'echo 1 | sudo tee {}/route_localnet'
find /proc/sys/net/ipv6/conf -name "vif*" -exec bash -c 'echo 1 | sudo tee {}/route_localnet'

Further considerations:

  1. There is no need to use unbound or dnsmasq since dnscrypt-proxy already caches DNS-requests.
  2. To run an extra VM for dnscrypt-proxy seemed a bit overkill to me.
  3. It is reasonable to trust dnscrypt-proxy since it is part of the fedora distribution which we put our trust in.
  4. Whonix Tor traffic is not affected, all traffic including DNS is still tunneled through the Tor network as far as I can tell. However, I am going to investigate by which means Tor is protecting DNS traffic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: networkingThis issue pertains to networking in Qubes OS.P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.R: duplicateResolution: Another issue exists that is very similar to or subsumes this one.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions