DNS Nameserver Setup

Kernels & Hardware, configuring network, installing services

DNS Nameserver Setup

Postby fsonnichsen » 2017-10-19 17:05

I am trying to set up nameserver lookup. Should be simple , yes? I simply want to code the IP address of our corporate nameserver "somewhere" and be done with it just like in the old resolv.conf days. Apparently for some reason "resolv.conf" was retired so I have tried a method vaguely referred to in the debian doc:

Here is what I have done:
I have stopped AND disabled the NetworkManager
I have coded, in my /etc/network/interfaces, the following:

auto enp11s0
iface enp11s0 inet static
....
....
dns-nameservers 172.20.30.31

My nssswitch.conf has the line:
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname.

I note that /etc/resolv.con points to /var/run/NetworkManager/resolv.conf. I expect this is a vestige of the original install but no longer important with NetworkManager turned off.

SO-I reboot and issues a few "host" commands to list various servers but nothing happens. I don't know of any command that lists all the name servers presently being used so I could not check this.

Can anyone tell me how to set up dsn look up in debian (without netmanager or resolveconf)

thanks
fritz
fsonnichsen
 
Posts: 11
Joined: 2015-11-30 18:44

Re: DNS Nameserver Setup

Postby tynman » 2017-10-19 23:16

The resolvconf package is still available in the Debian repositories. It doesn't get installed by default by the Debian installer, but I hadn't heard it had been "retired". Maybe I missed the news item?

The default setup in Debian I believe is to use Network Manager and assume most people will use their ISP's DNS. But clearly there are other options, for the tweak-heads and for data center servers, etc.
tynman
 
Posts: 48
Joined: 2016-05-03 19:48
Location: British Columbia, Canada

Re: DNS Nameserver Setup

Postby p.H » 2017-10-20 08:14

tynman wrote:The resolvconf package is still available in the Debian repositories

The OP wrote about the resolv.conf file, not the resolvconf package. Neither has been retired so far.
Some packages such as resolvconf (and apparently NetworkManager, which I was not aware of) replace the /etc/resolv.conf file with a symbolic link pointing to a dynamically managed file. However this is transparent for applications using /etc/resolv.conf for resolution.

tynman wrote:The default setup in Debian I believe is to use Network Manager

No. NetworkManager only comes by default with some desktop environments such as Gnome. By default LXDE installs Wicd instead.

fsonnichsen wrote:dns-nameservers 172.20.30.31

Note that dns-* options in /etc/network/interfaces require the resolvconf package to have any effect.
p.H
 
Posts: 158
Joined: 2017-09-17 07:12

Re: DNS Nameserver Setup

Postby fsonnichsen » 2017-10-20 11:47

Thank you for the replies here. I have indeed installed gnome which apparently likes to bring along the NetworkManager. I am trying to simply hard code the DNS server IP in /etc/resolv.conf and be done with it. (the NetworkManager has caused problems for me in the past.) When I code the IP for our DNS server in the /etc/resolv.conf it vanishes after reboot (which is why I implied it was retired). So-my question still stands-is it possible for a UNIX refugee from the SUN-OS days to still use revolv.conf, and if so, how? Short of this I suppose I can put NetworkManager in.

thanks all
Fritz
fsonnichsen
 
Posts: 11
Joined: 2015-11-30 18:44

Re: DNS Nameserver Setup

Postby Head_on_a_Stick » 2017-10-20 15:18

fsonnichsen wrote:I note that /etc/resolv.con points to /var/run/NetworkManager/resolv.conf. I expect this is a vestige of the original install but no longer important with NetworkManager turned off.

Delete the symlink and create a new /etc/resolv.conf, populated to your liking.

As long as you have static routes defined in /etc/network/interfaces (and no silly resolv.conf-managing programs running) then you shouldn't even need the dns-nameservers line because /etc/resolv.conf will never be touched ;)
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6669
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Nameserver Setup

Postby sunrat » 2017-10-20 22:01

I had a similar issue recently, fixed by editing dhclient.conf. See this answer at siduction forum:
https://forum.siduction.org/index.php?t ... 4#msg55434
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2036
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: DNS Nameserver Setup

Postby Head_on_a_Stick » 2017-10-20 22:03

sunrat wrote:I had a similar issue recently, fixed by editing dhclient.conf

The OP has declared static addresses in /etc/network/interfaces so dhclient will not be invoked at all.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6669
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Nameserver Setup

Postby fsonnichsen » 2017-10-30 12:31

Thanks all.
Re: "head-on-a-stick"--- "Delete the symlink and create a new /etc/resolv.conf"
This worked. I had avoided this at first as I didn't know what avalanche of problems deleting an install generated file might create. The inviting thing about linux a few years back was its lack of bloatware and more important, lack of intertwined labyrinths of file structures to do simple things. In fact I could often clone a system by copying /etc/ directory and little else. Maybe I am overreacting but it seems like unwarranted complexity has been added lately and this is complicated by very diffuse documentation.

thanks again
Fritz
fsonnichsen
 
Posts: 11
Joined: 2015-11-30 18:44


Return to System configuration

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable