Configure Static DNS with DHCP on Debian

Purpose : configure your system to use your choice of DNS servers.

Why update DNS servers addresses?

  • you wish to use your own private DNS server
  • access your network devices by using a FQDN (fully qualified domain name) instead of an IP address
  • your ISP’s DNS servers are slow, creating a sluggish browsing experience

There are many free/public DNS servers. Here is a small list:

  1. Freenom: 80.80.80.80, 80.80.81.81
  2. Google: 8.8.8.8, 8.8.4.4
  3. OpenDNS: 208.67.222.222, 208.67.220.220
  4. FreeDNS: 37.235.1.174, 37.235.1.177
  5. Level3: 209.244.0.3, 209.244.0.4
  6. Cloudflare: 1.1.1.1, 1.0.0.1
  7. Quad9: 9.9.9.9, 149.112.112.112

When updating your DNS servers, always check with the provider to make sure they do not log any private information (e.g. requested IP addresses, ISP, or your geographic location)

To update the DNS servers on Debian you need to:

  1. edit the /etc/dhcp/dhclient.conf file
  2. restart the networking service

Simply adding the DNS servers to theĀ /etc/resolv.conf file is not going to make the changes permanent. They will only last until your restart your dhcp client or reboot your system. This method is useful if you need to temporarily use or test new DNS servers.

Procedure:

1. Edit the /etc/dhcp/dhclient.conf file

To add static DNS servers that are used in addition to the ones provided by DHCP, use prepend

prepend domain-name-servers aaa.aaa.aaa.aaa, bbb.bbb.bbb.bbb

To completely override the DNS servers provided by DHCP, and entirely force the system to use only the ones you provide, use supersede

supersede domain-name-servers aaa.aaa.aaa.aaa, bbb.bbb.bbb.bbb

2. Restart the networking service

sudo /etc/init.d/networking restart

3. Check the /etc/resolv.conf file to make sure the new DNS servers where added.

Force SSL in Piwik

  • navigate to Piwik installation folder
  • edit the file: config/config.ini.php
  • add the following in the general section
[General]
force_ssl = 1

Alternatively, you can download the Force-SSL plugin from the Marketplace.