Wiki Table of Contents

Static DNS


On this page:


When web surfing slows down constantly and on many sites, one of the remedies is to try different DNS Servers to see if one is faster than another in your area, since slow DNS lookups are going to result in slow page load times. The easiest way to change is by switching DNS servers, either for the entire local area network (LAN) or for a single machine. Whichever you choose, be sure to back up your current settings, whether by using the router software or by simply writing down the existing servers.

Disclaimer: the possibility and effectiveness of any such change may vary by region and ISP. You can check the possibility of changing by using the OpenDNS site (see below): open a terminal and enter

nslookup -type=txt debug.opendns.com. 208.67.222.222

LAN change

To set up static DNS for the entire LAN, you need to change the settings in your router. That way, all of the devices on your LAN will use the DNS servers you configured by default, assuming you’re using a typical configuration with your computers grabbing a new local IP address and DNS addresses from your router each time they attach to it.

For most routers, the default address to get to their admin screens from a browser on your LAN is one of these:

  • http://192.168.1.1
  • http://192.168.0.1
  • http://192.168.1.254

Default user/password is commonly admin/admin or admin/password. If that doesn’t work and you have forgotten your password, there is usally a reset button on the back or bottom of the router.

OpenDNS

OpenDNS is free for home use, and has some fairly detailed instructions online for many router models. But, they’re all fairly easy to set up for your preferred DNS Servers (see below).

Click the Home Routers button from the Setup page listed below, then on the page that comes up select a configuration (such as “Generalized Router Configuration”) that suits your needs.

https://store.opendns.com/setup//

Generalized instructions can be found here:

https://support.opendns.com/entries/27350174-Generalized-Router-Configuration-Instructions

Single machine change

Changes made on the router affect anyone using the LAN. For users connecting directly to the internet without a router, or wishing only to change a particular machine, there are two methods of proceeding.

GUI Method

Network Manager provides a convenient way to set up static DNS servers.

  • Right-click the icon in the Notification Area > “Edit Connections…”
  • Select the connection you want to use and click the Edit button.
  • Go to the IPv4 tab, and change the “Method” to DHCP (Automatic) Addresses Only from the drop down list (assuming your router is assigning your local address via DHCP).
  • Put the addresses in the ” DNS Servers” field, separated by a comma.
  • Click Save and exit.

When you use DHCP Automatic, Addresses Only you still get your local IP address from your router. But instead of using your router’s DNS server addresses, you can use other addresses for improved performance.

TIP: if you switch DNS servers frequently, you can use the “New” button to set up multiple entries in the Network Connections box, cloning the hardware information and specifying different DNS servers for each.

CLI method

Open a terminal, become root and type:

leafpad /etc/dhcp/dhclient.conf

After this line #prepend domain-name-servers 127.0.0.1;, copy/paste to add this line (here, OpenDNS servers are being used):

prepend domain-name-servers 208.67.222.222,208.67.220.220;

Be careful to use the exact syntax (spaces, semicolons, ,etc.). Save and reboot.

DNS Servers

You can compare your current DNS Server with others by installing namebench and python-tk (so you can see the GUI) and typing this command in a terminal as regular user:

namebench

The output will be located in tmp/ as html and csv.

Here are some of the public DNS servers (see Links for others) commonly used:

Google Public DNS:

8.8.4.4

8.8.8.8

Norton Connectsafe DNS:

198.153.194.40

198.153.192.40

OpenDNS:

208.67.220.220

208.67.222.222

Comodo DNS:

8.20.247.20

8.26.56.26

Restoration

To restore default settings, open Network Manager, and use the drop-down menu to select Automatic (DHCP). When you reboot, the servers supplied by your ISP will be used. You may have to also undo any  changes made using the methods above.

Alternatively, you can reedit /etc/dhcp/dhclient.conf to enter settings you have backed up before changing.


v. 20150726

6 thoughts on “Static DNS”

  1. Excellent. After editing that my pc resolve as normal. VPN messed things up after i accidentally launched two wireguard sessions at the same time (wg-quick up yaddayadda x 2, not good). Now its working as usual. Wish Wireguard had an option to block it from starting more than one session.

    Reply

Leave a Comment

Do NOT follow this link or you will be banned from the site!