I want my Raspberry Pi to use OpenDNS to resolve domain names. How can I modify this setting?
If you are using Debian on Raspberry Pi, then you need to edit
then add the server IP of the openDNS
Btw, if you have any concern about speed of the DNS you may want to take a look at this post
I've found that in the latest version of Raspbian (stretch I think?) you now need to edit the last line of
/etc/dhcpcd.conf. There should be a line that starts with
static domain_name_servers= - there you can customise it with a list of space-separated DNS servers, like this:
static domain_name_servers=184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124
Edit: As @DavidOliver points out, you may need to restart dhcpcd too:
sudo systemctl restart dhcpcd.service.
I have found the answer from another website and this is the best. I used the very last part of the article as Raspbian comes with dchpcd already installed and i still want an automatic ip address not a static ip address. Running from a Raspberry Pi3 multiboot [berryboot] with Raspbian - Pixel type
sudo nano /etc/resolv.conf.head
in your terminal. You will have a blank slate to work with. Next copy and paste the following code:
click on cntrl + x to exit out and select y for the following options to save. restart your Raspberry Pi with
To make sure you are using OpenDNS go to the following website: OpenDns welcome page
The openDNS servers worked for me thanks. During a Udemy learning session I had run into a problem after ditching my wifi sharing arrangement with my Mac, and setting up ethernet hub with the PI on a different home network. The problem with my previous IP sharing arrangement with WiFi.
When I originally setup the PI with the sharing arrangement the text Inside the resolve file was:
which was entered automatically by the minibian OS, NOT ME!
This IP became the default DNS server, with the MacMini seamlessly providing the real DNS in the background.
SO NEED TO EDIT(vim) WITH
Then I could ping google.com Thank goodness for forums!