How to Override the DNS Server in UBUNTU
- 1). Open the Terminal program. This can typically be done by pressing "CTRL", "ALT" and "T" on your keyboard simultaneously. You can also find it by clicking "Dash", "More Apps" then "Accessories."
- 2). Type in the following command, then press "Enter."
sudo gedit /etc/resolv.conf
The Sudo window will open. - 3). Change or add the following lines:
nameserver your_DNS_server_1
nameserver your_DNS_server_2
"your_DNS_server_(#)" should be the IP address or hostname of the DNS server you wish to use. - 4). Type :wq to save and quit. You may need to restart your system for changes to take place.
Source...