Threat Level: green Handler on Duty: Didier Stevens

SANS ISC: InfoSec Handlers Diary Blog InfoSec Handlers Diary Blog

Sign Up for Free!   Forgot Password?
Log In or Sign Up for Free!
ISC Stormcast For Thursday, June 15th 2017

Systemd Could Fallback to Google DNS?

Published: 2017-06-14
Last Updated: 2017-06-14 06:16:44 UTC
by Xavier Mertens (Version: 1)
2 comment(s)

Google is everywhere and provides free services to everyone. Amongst the huge list of services publicly available, there are the Google DNS, well known as, (IPv4) and 2001:4860:4860::8888, 2001:4860:4860::8844 (IPv6). But Google is far from being a non-profit organisation and they collect a lot about you via their DNS[1]. Nothing is free and, when you get something for “free”, you (your data) are the valuable stuff. Never forget this!

It is already known that many systems are using the Google DNS as a fallback configuration. Docker is a good example. As written in the documentation[2]:

After this filtering, if there are no more nameserver entries left in the container's /etc/resolv.conf file, the daemon adds public Google DNS nameservers ( and to the container’s DNS configuration. If IPv6 is enabled on the daemon, the public IPv6 Google DNS nameservers will also be added (2001:4860:4860::8888 and 2001:4860:4860::8844)

Yesterday, there was some interesting tweets passing around about the same kind of behaviour but for systemd[3]. 

"systemd" is the new system introduced in 2012 to replace the good old “init”. It is used to manage processes started at boot time (in userland space). systemd introduced a lot of new features but also was the reason of major flamewars in the Linux community about pros and cons of the new system.

In the GitHub repository of systemd, in the file, we can read the following block of code[4]:

                [space-separated list of default DNS servers]),
        [DNS_SERVERS=" 2001:4860:4860::8888 2001:4860:4860::8844"])

How to interpret this code? systemd has a built-in fallback mechanism that specifies, at compilation time, that if no resolvers are configured, it uses the Google DNS by default! I performed a quick check on different Linux distributions (installed out-of-the-box):

Distribution Comments
ArchLinux Found the commented line in /etc/systemd/resvolved.conf:
#FallbackDNS= 2001:4860:4860::8888 2001:4860:4860::8844
CentOS Nothing found
CoreOS Nothing found
Debian Nothing found
Fedora Found the commented line in /etc/systemd/resvolved.conf:
#FallbackDNS= 2001:4860:4860::8888 2001:4860:4860::8844
Gentoo Nothing found
OpenSuse Nothing found
RedHat ES Not tested
Suse ES Not tested
Ubuntu Nothing found

Some distributions, like Slackware, never implemented systemd.

This ‘FallbackDNS’ purpose is defined here[5]

A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers. Any per-link DNS servers obtained from systemd-networkd.service(8)  take precedence over this setting, as do any servers set via DNS= above or /etc/resolv.conf. This setting is hence only used if no other DNS server information is known. If this option is not given, a compiled-in list of DNS servers is used instead.

I also found an old report about this in the Debian bug tracker[6].

But the DNS configuration is not the only one to be affected, a list of default NTP servers is also preconfigured at compilation time[7]:

                [space-separated list of default NTP servers]),

Ok, nothing really critical here. Based on the tested distributions, there is almost no risk to see systemd falling back to the Google DNS. However, this is a good signal to keep in mind that some developers might introduce dangerous features and/or configurations in their code. Grepping for static IP addresses in configuration files is always a good reflex. About the DNS, my recommendation is to restrict the DNS traffic on your network and run your own resolver. 


Xavier Mertens (@xme)
ISC Handler - Freelance Security Consultant

Keywords: dns google linux systemd
2 comment(s)
Diary Archives