Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

/etc/network/interfaces

Wed Apr 01, 2015 10:54 pm

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?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

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

Re: /etc/network/interfaces

Wed Apr 01, 2015 11:12 pm

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.
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.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: /etc/network/interfaces

Wed Apr 01, 2015 11:14 pm

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.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

W. H. Heydt
Posts: 12648
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: /etc/network/interfaces

Wed Apr 01, 2015 11:18 pm

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.

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

Re: /etc/network/interfaces

Wed Apr 01, 2015 11:35 pm

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.
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.

User avatar
rpdom
Posts: 17171
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: /etc/network/interfaces

Thu Apr 02, 2015 6:35 am

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.

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: /etc/network/interfaces

Thu Apr 02, 2015 8:27 am

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".

Return to “General discussion”