Page 1 of 1

/etc/network/interfaces

Posted: Wed Apr 01, 2015 10:54 pm
by Joe Schmoe
Two questions:
  1. What is the magic syntax to put in this file so that wlan0 will use a given DNS instead of whatever the ISP hands out? The problem we are trying to fix is that the DNS set by the ISP is trash (doesn't work). I want to force it to use 8.8.8.8
  2. Where is this language (the language of the "interfaces" file) documented?

Re: /etc/network/interfaces

Posted: Wed Apr 01, 2015 11:12 pm
by DougieLawson

Code: Select all

auto lo
iface lo inet loopback

#auto eth0
iface eth0 inet dhcp
#iface eth0 inet static
#address 192.168.1.9
#gateway 192.168.1.254
#netmask 24
dns-nameservers 192.168.1.11 8.8.8.8
dns-search example-dns-stuff.bogus
dns-domain example-dns-stuff.bogus

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off
iface default inet static
address 192.168.1.9
gateway 192.168.1.254
netmask 24
dns-nameservers 192.168.1.11 8.8.8.8
dns-search example-dns-stuff.bogus
dns-domain example-dns-stuff.bogus
It's all part of the DebIan network-manager package. I'm not sure if that includes man pages or /share/package/docs files.

Re: /etc/network/interfaces

Posted: Wed Apr 01, 2015 11:14 pm
by Joe Schmoe
FYI: Dougie's response was not useful to me.

This is not meant as a criticism of Dougie, but rather as a note to others to not consider this thread closed.

Re: /etc/network/interfaces

Posted: Wed Apr 01, 2015 11:18 pm
by W. H. Heydt
The answer depends. Do you have a router between your Pi and your DSL/cable modem? If so, you should be able to set your DNS entries in the router.

Re: /etc/network/interfaces

Posted: Wed Apr 01, 2015 11:35 pm
by DougieLawson
Joe Schmoe wrote:FYI: Dougie's response was not useful to me.

This is not meant as a criticism of Dougie, but rather as a note to others to not consider this thread closed.
No worries.
Try
sudo apt-get install resolvconf
I have a distant memory of that being the thing that messes with /etc/resolv.conf based on the

Code: Select all

dns-nameservers 192.168.1.11 8.8.8.8
dns-search darkside-internet.bogus
dns-domain darkside-internet.bogus
in /etc/network/interfaces.

Re: /etc/network/interfaces

Posted: Thu Apr 02, 2015 6:35 am
by rpdom
DougieLawson wrote:It's all part of the DebIan network-manager package.
Actually network-manager is an entirely different thing that pretty much ignores the interfaces file and does it's own thing. I've always found it more of a pain than a help, so I never use it.

To get the basics of the /etc/network/interfaces you can "man interfaces" or see the online manpage.

Re: /etc/network/interfaces

Posted: Thu Apr 02, 2015 8:27 am
by allfox
Joe Schmoe wrote:Two questions:
  1. What is the magic syntax to put in this file so that wlan0 will use a given DNS instead of whatever the ISP hands out? The problem we are trying to fix is that the DNS set by the ISP is trash (doesn't work). I want to force it to use 8.8.8.8
  2. Where is this language (the language of the "interfaces" file) documented?
1. I think it would be better if you could describe your system deployment so that we could give an answer, such as if there would be an wireless router that dial to ISP via PPPOE ? As the only information about your deployment is the interface name "wlan0", I suggest that your Pi connect to an access point via wireless. You may configure that access point (maybe a router?) to use static DNS. The Pi itself read /etc/resolv.conf to determine DNS, however many program could overwrite this file to give you a particular DNS from some providers, such as pppd would do so to set DNS to the ISP provided one. Maybe a dirty solution is to edit /etc/resolv.conf to 8.8.8.8 and make it read-only. We need more information about how you connect to ISP to tell a cleaner answer.

2. There is a man page which you could read via command "man interfaces".