Whonix-Gateway System DNS

From Whonix
Jump to navigation Jump to search

Robot-162087640.png

Introduction[edit]

System DNS here is defined as:

  • resolving DNS,
    • without use of a socksifier such as torsocks,
    • without application proxy settings,
    • without a Tor SocksPort.
  • using the usual mechanisms on Linux for resolving DNS.
  • that are usually configured through configuration file /etc/resolv.conf.
  • that would happen when running nslookup.

All traffic originating from Whonix-Workstation ™ and Whonix-Gateway ™ is routed over Tor. [1] [2] [3] [4] [5] [6] [7]

Whonix-Workstation ™ is configured to use various SocksPorts, DNSPort and TransPort, see also Stream Isolation. Using system DNS on Whonix-Workstation ™ by default does not require Whonix-Gateway ™ system DNS. [8] Modifications of /etc/resolv.conf on Whonix-Gateway ™ have no effect on Whonix-Workstation ™.

Whonix-Gateway ™ is only configured to use various SocksPorts. A global system DNS resolver to resolve DNS originating from applications running on Whonix-Gateway ™ is not required for any common use case to justify enabling it by default. Use cases where this could be useful include:

  • resolving the hostname of a proxy used in /usr/local/etc/torrc.d/50_user.conf through Tor would be useful (technical explanation)
  • resolving the hostname of a VPN. But then using a VPN configuration using IPs only would be better.
  • Perhaps we could use /etc/hosts for such use cases rather than enabling system DNS?

Whonix-Gateway System DNS over Clearnet[edit]

Setup[edit]

Usually recommended against and unnecessary.

Clearnet Whonix-Gateway System DNS.

1. Make the following modifications to Whonix-Gateway ™.

Open file /etc/resolv.conf in an editor with administrative (root) write permissions.

This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/resolv.conf

2. Uncomment #nameserver 10.0.2.3.

Remove the hash ("#") in front of nameserver. In other words, replace #nameserver 10.0.2.3 with nameserver 10.0.2.3.

3. Platform specific steps.

  • Non-Qubes-Whonix ™: Done.
  • Qubes-Whonix ™: Replace 10.0.2.3.
    • To find out that IP to replace it with, run the following command.
    • qubesdb-read /qubes-netvm-primary-dns
    • Should show for example:
    • 10.139.1.1

    • Replace 10.0.2.3 with 10.139.1.1. Note: Replace it with the actual IP, the output of above qubesdb-read /qubes-netvm-primary-dns command.

4. Done.

The Whonix-Gateway System DNS has been completed.

Test[edit]

Using Whonix-Gateway ™ user clearnet.

Ambox warning pn.svg.png Using the clearnet user account, traffic will be sent over normal internet! Not over Tor! Will not be anonymous!

Start bash under user clearnet.

[9]

sudo -u clearnet bash

Test it, for example using ping.

ping google.com

Whonix-Gateway System DNS over Tor[edit]

Usually recommended against and unnecessary.

Torified Whonix-Gateway System DNS.

Undocumented.

Whonix-Gateway Default System DNS Setting[edit]

At time of writing, none configured. Too verify, the following command all lines in the system DNS configuration file file /etc/resolv.conf except commented out files, those starting with a hash ("#").

cat /etc/resolv.conf | grep --invert-match \#

Changing this might be safe, useful and required for Bridges, pluggable transport, meek and easier snowflake support:

https://forums.whonix.org/t/censorship-circumvention-tor-pluggable-transports/2601/40

See Also[edit]

Footnotes[edit]

  1. Since Whonix ™ version 0.2.1 Whonix-Gateway ™ traffic is also routed over Tor. In this way, use of Whonix ™ is hidden from persons or systems observing the network.
  2. To preserve the anonymity of a user's Whonix-Workstation ™ activities, it is not necessary to torify Whonix-Gateway ™ own traffic.
  3. For reader interest: If DNS settings on Whonix-Gateway ™ are changed in /etc/resolv.conf, this only affects Whonix-Gateway ™ own DNS requests issued by applications using the system's default DNS resolver. By default, no applications issuing network traffic on Whonix-Gateway ™ use the system's default DNS resolver. All applications installed by default on Whonix-Gateway ™ that issue network traffic (apt, systemcheck, sdwdate) are explicitly configured, or forced by uwt wrappers, to use their own Tor SocksPort (see Stream Isolation).
  4. Whonix-Workstation ™ default applications are configured to use separate Tor SocksPorts (see Stream Isolation), thereby not using the system's default DNS resolver. Any applications in Whonix-Workstation ™ that are not configured for stream isolation - for example nslookup - will use the default DNS server configured in Whonix-Workstation ™ (via /etc/network/interfaces), which is the Whonix-Gateway ™. Those DNS requests are redirected to Tor's DnsPort by Whonix-Gateway ™ firewall. Whonix-Gateway ™ /etc/resolv.conf does not affect Whonix-Workstation ™ DNS requests.
  5. Traffic generated by the Tor process itself which runs by Debian default under user debian-tor originating from Whonix-Gateway ™ can use the internet normally. This is because user debian-tor is exempted in Whonix-Gateway ™ Firewall, allowed to use the "normal" internet.
  6. The Tor software (as of 0.4.5.6) (and no changed were announced at time of writing) almost exclusively uses TCP traffic. See also Tor wiki page, chapter UDP. For DNS, see next footnote.
  7. Tor does not require, use functional (system) DNS for most functionality. IP addresses of Tor directory authorities are hardcoded in the Tor software as per Tor upstream default. Exceptions include:
    • proxy settings using proxies with host names rather than IP addresses
    • the Tor pluggable transport meek lite to resolve domains used in setting url=, front= to IP addresses.
  8. That is because DNS traffic originating from Whonix-Workstation ™ gets redirected to Tor's DNSPort running on Whonix-Gateway ™ by Whonix-Gateway Firewall.
  9. Similar to login as user clearnet.