dns-nameservers being ignored

Kernels & Hardware, configuring network, installing services

dns-nameservers being ignored

Postby creeping » 2012-08-07 05:34

Hi, I have just moved from Ubuntu to Debian, yay :P Anyway... In Ubuntu I could use the following statements in /etc/network/interfaces
Code: Select all
iface eth0 inet static
address 192.168.30.97
netmask 255.255.255.0
gateway 192.168.30.200
dns-nameservers 192.168.30.96
dns-domain jit.local
dns-search jit.local


My /etc/resolv.conf would be overwritten with (as expected):
Code: Select all
domain jit.local
search jit.local
nameserver 192.168.30.96


But when I use the same statements in Debian I have no DNS resolution. The line "nameserver 192.168.30.96" is not being added to /etc/resolv.conf. If I manually add "nameserver 192.168.30.96" to /etc/resolv.conf then DNS resolution works fine.

I have removed all DHCP packages
Code: Select all
aptitude purge dhcp3-client dhcp3-common isc-dhcp-client isc-dhcp-common

I am not using resolvconf or network-manager

I would prefer to not use /etc/resolv.conf as I hear other applications can mess with the file.

No other files exists like:
/etc/dhclient.conf
/etc/dhcp/dhclient.conf
/etc/dhcp3/dhclient.conf
where statements supersede can be used.

ifup eth0 returns: "ifup: interface eth0 already configured"
I read you need to install resolvconf in order to have the dns-nameservers line processed in /etc/network/interfaces, which I don't wont to do unless I have no choice.

Any ideas on what to try next?

Thanks.
creeping
 
Posts: 3
Joined: 2012-08-07 05:17

Re: dns-nameservers being ignored

Postby bw123 » 2012-08-07 07:50

Kinda confusing, you don't want to use /etc/resolv.conf, but you are trying to get ifup to add a nameserver to /etc/resolv.conf

beats me what the problem is, but yeah it looks like package resolvconf will resolve your problem

http://www.debian.org/doc/manuals/debia ... _static_ip

except you'll be using /etc/resolv.conf if you do it this way.


I have resolved not to use resolvconf, but I do use /etc/resolv.conf
wheezy/fluxbox, GNU/Linux 3.10-0.bpo.3-amd64
User avatar
bw123
 
Posts: 1826
Joined: 2011-05-09 06:02
Location: TN_USA

Re: dns-nameservers being ignored

Postby creeping » 2012-08-07 10:35

Sorry, I should of mentioned I am new to linux and just know some basics as you can probably tell. I did not know ifup added the name server to /etc/resolv.conf. I just added that command output as I saw someone else did that with the same sort of issue in another forum.

So basically... If I install resolvconf, it will add the name servers from /etc/network/interfaces to /etc/resolv.conf and then no other application can override them, just append more?

This install will be a server and I just want to make sure that only the name servers I want are used and no other application will decide add more or change them.

I might have been confused as I have setup another Debian box as a DNS (BIND) server using forwarders and that /etc/resolv.conf has no name servers, but I hard coded 127.0.0.1 in /etc/network/interfaces and DNS lookups resolve fine.
Correct me if I am wrong, but DNS is working beacuse of the forwarders? And the 127.0.0.1 is not even used?
creeping
 
Posts: 3
Joined: 2012-08-07 05:17

Re: dns-nameservers being ignored

Postby cynwulf » 2012-08-07 10:44

/etc/resolv.conf gets overwritten by most networking daemons, the cheap and dirty way to prevent this is to make it read only... but there are various means of achieving the same end, refer to the wiki: http://wiki.debian.org/NetworkConfiguration

typo: resolve/resolv
Last edited by cynwulf on 2012-08-07 15:34, edited 2 times in total.
cynwulf
 
Posts: 2397
Joined: 2008-09-25 08:49

Re: dns-nameservers being ignored

Postby Quantum » 2012-08-07 15:28

.
Last edited by Quantum on 2012-08-13 01:02, edited 1 time in total.
Quantum
 
Posts: 1455
Joined: 2006-03-21 19:06
Location: Seattle, Ecotopia

Re: dns-nameservers being ignored

Postby creeping » 2012-08-08 00:32

Cool, Getting to understand with how it all fits together with these posts and links. One final question if you don't mind... If you don't recommend using resolvconf (which I agree with) and configuring a nameserver under eth0 in /etc/network/interfaces does seem to work (which I have also found)... surely there must be a recommended way to configure it.
I thinking I might just remove all DHCP packages, network-manager and resolconf. Set /etc/resolv.conf manually and do the dirty read only.
creeping
 
Posts: 3
Joined: 2012-08-07 05:17

Re: dns-nameservers being ignored

Postby nadir » 2012-08-08 01:50

viewtopic.php?f=5&t=54320#p313761

Short ago i asked the same question. I use what is said in the link above now. All other methods i tried didn't work properly (resolvconf made my network crash. I think).
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.
User avatar
nadir
 
Posts: 5965
Joined: 2009-10-05 22:06
Location: away

Re: dns-nameservers being ignored

Postby ckollars » 2013-01-30 03:33

You're not the only one that may find this confusing. Writing/re-writing/over-writing of /etc/resolv.conf is one of the things that didn't work very well when the old *nix way was integrated into more modern environments, and so in this area the Posix standard isn't terribly reasonable. There have been quite a few different "solutions" ...many of them distribution-specific, many of them different from one version to the next, and many more that are "custom" or "non-standard" or available for some but not all distros. If you change distros, 99% of Linux remains the same ...but this belongs to that troublesome 1%. :)
ckollars
 
Posts: 1
Joined: 2013-01-30 03:21


Return to System configuration

Who is online

Users browsing this forum: No registered users and 22 guests

fashionable