Set DNS server on LXDE (Ubuntu)

lxdeI prefer the Google DNS servers (8.8.8.8/8.8.4.4) for faster DNS resolution. While the procedure to set it on Unity is trivial, setting it on LXDE needs little more effort.

  1. Edit /etc/NetworkManager/NetworkManager.conf and comment out the line starting with dns.
    dns=dnsmasq
    to
    #dns=dnsmasq
  2. Edit /etc/resolv.conf and add the preferred nameservers before any other entries.
    #Google
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    #OpenDNS
    nameserver 208.67.222.222
    nameserver 208.67.220.220
  3. Reboot and ensure the settings took effect.
    $ nslookup www.google.com
    Server: 8.8.8.8
    Address: 8.8.8.8#53
    ...

This procedure is tested on Ubuntu 14.04 (aka Trusty Tahr).

Get your own domain name

cool_penguin_smallIf you are interested in getting your own domain name for free you can try the following two options depending on the type of hosting you have:

  1. co.nr: If you have your site hosted somewhere other than your own storage co.nr is a good option. You can register a domain name like mypage.co.nr. It is free with some basic mandates. No Ads. co.nr also supports if you have your site hosted in your own computer but I liked the second option more for this scenario.
  2. noip.com: If your system is on 24×7 this is the free service you can opt for. It works whether your IP is static of dynamic. It has it’s own client software for Linux, Windows and Mac which pings back to update the IP. No Ads.

Modify DNS server address on Ubuntu

My ISPs DNS server responds slowly. So I was trying to modify /etc/resolv.conf on Ubuntu 12.04 with Google’s DNS server IPs (8.8.8.8, 8.8.4.4) as usual. To make the change permanent I ran chattr +i on the file but it failed. I found that in Ubuntu 12.04 it is a symbolic link to the following file:

/run/resolvconf/resolv.conf and /run is mounted as tmpfs in RAM.

Simple solution to add the DNS IPs using the GUI:

NetworkManager (in taskbar)  Edit Connections…  Select used connection  Edit…  IPv4 Settings  Method: Automatic (DHCP) addresses only [if your conneciton is DHCP based, otherwise select Manual]  Add the IPs (separated by comma) in DNS servers: field.

Quick tip: If you are using ADSL modem, you can set the Primary and Secondary DNS in the modem. Most modems support it nowadays.