Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

dns-nameservers being ignored

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
creeping
Posts: 3
Joined: 2012-08-07 05:17

dns-nameservers being ignored

#1 Post by creeping »

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.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: dns-nameservers being ignored

#2 Post by bw123 »

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
resigned by AI ChatGPT

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

Re: dns-nameservers being ignored

#3 Post by creeping »

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?

cynwulf

Re: dns-nameservers being ignored

#4 Post by cynwulf »

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

Quantum
Posts: 1458
Joined: 2006-03-21 19:06
Location: Seattle, Ecotopia

Re: dns-nameservers being ignored

#5 Post by Quantum »

.
Last edited by Quantum on 2012-08-13 01:02, edited 1 time in total.

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

Re: dns-nameservers being ignored

#6 Post by creeping »

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.

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: dns-nameservers being ignored

#7 Post by nadir »

http://forums.debian.net/viewtopic.php? ... 20#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.

ckollars
Posts: 1
Joined: 2013-01-30 03:21

Re: dns-nameservers being ignored

#8 Post by ckollars »

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%. :)

Post Reply