timl
Posts: 44
Joined: Sat May 04, 2013 3:41 am

DNS

Thu Sep 11, 2014 11:14 pm

Hi, I am not familiar with debian and my raspbian wifi setup has been cobbled together. I would like to assign Google's DNS address.

I assign static IP addresses to all my computers and, originally, I found the best method to achieve this with raspbian was to use the router to assign an IP address to the MAC address of the wifi card. I did this and all is fine. My interfaces file looks like:
pi@resurgam ~ $ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
A quick flick around the net suggests I just need to add 8.8.8.8 to /etc/resolv.conf so
nameserver 192.168.1.1
becomes
nameserver 192.168.1.1 8.8.8.8
Is that correct? Then I have to restart wlan0?

Cheers

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: DNS

Thu Sep 11, 2014 11:54 pm

It's wrong.

You can
either sudo apt-get install resolvconf and add dns-nameserver lines to /etc/network/interfaces
or you can code the nameservers by hand in /etc/resolv.conf (separate nameserver www.xxx.yyy.zzz line for each)
or you can update your DHCP server to send the right DNS server addresses when a DHCP client renews their lease.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

timl
Posts: 44
Joined: Sat May 04, 2013 3:41 am

Re: DNS

Fri Sep 12, 2014 2:18 am

Thanks for the suggestions:

option 1 I don't really understand so I'll have to read up on that
2nd option sounds really easy but I'll have to read up on that
DHCP server. I can see that my router has DNS entries which I have never looked at before. This seems like the most logical place to make the change so I'll see how this works

Cheers

Return to “Raspberry Pi OS”