Web lists-archives.com

Re: Why does resolv.conf keep changing?




On Tuesday 24 October 2017 23:46:47 Felix Miata wrote:

> Gene Heskett composed on 2017-10-24 22:52 (UTC-0400):
> >> On Mon, Oct 23, 2017 at 20:31:05 -0400, Gene Heskett wrote:
> >>>and made immutable. Particularly is the fact that /etc/resolv.conf
> >>> isn't a link to something else but contains:
> >>>
> >>>nameserver 192.168.XX.1
> >>>search 	host	dns
> >>>domain coyote.den
>
> ...
>
> > Now, since my home net is host file based, about 8 machines and a
> > printer these days, I make resolv.conf into a real file, and
> > once /etc/network/interfaces is similarly setup to work, both are
> > then made immutable, at which point resolvconfig and N-M can be like
> > a steer, try, but cannot tear down a working circuit, that it can
> > never bring back to life despite continueing efforts. Both N-M and
> > resolvconfig are solutions looking for a problem I don't have
> > anymore.
>
> ...
>
> > Your turn Mike, but lets see the facts as to why its wrong, not just
> > an argument for the sake of arguing.  The list doesn't need that, it
> > needs tutorials.
>
> Apparently no one else is interested in tutoring, so I'll offer this:
>
> 1-My LAN is configured essentially the same as yours, including a 2k
> hosts file.
>
> 2-My lines 1 are always the search lines, each starting with the word
> "search", followed by domain(s) to be searched, e.g. "search mylan.net
> coyote.den someother.biz"
>
> 3-My lines 2[3,4,...] are always nameserver lines, containing only the
> string "nameserver" followed by one IPV4 address.
>
> 4-I have no lines starting with string "domain", but as a result of
> this thread, that may soon change.
>
> NAICT from the man page, Mike's objection to yours is your search line
> should contain neither the string "dns" nor the string "host", and
> probably ought to contain at least the string "coyote.den" following
> the string "search".

Whereas my theory has always been WRT the search line, that it should 
first search the  /etc/hosts file for a name match, and failing that, 
query my router, which is running dd-wrt which means its running 
dnsmasq.

Now, if dnsmasq doesn't have it in its cache, then the router will query 
the dns server that it obtained from the isp via its dhcp session with 
the isp.

Frankly, "man resolv.conf" is one of the poorer man pages we have. 
Without covering the fundamentals, it wastes 8 kilobytes on options most 
folks don't know or care about.

Quite a ways down the page, I see this:

"The domain and search keywords are mutually exclusive.  If more than one 
instance of these keywords is present, the last instance wins."

Other stanza's seem to say I should replace 'hosts' with the local domain 
name, 'coyote.den' as the first argument to the search keyword. And I 
cannot tell if its doing anything different, I changed it and restarted 
my networking without disturbing the ssh sessions opened to the other 
machines, they are still up and accessable w/o logging in a new session, 
and I can still ping yahoo in 112ms.

A partial cat of /etc/network/interfaces:

auto eth0
# regular network for coyote.den
iface eth0 inet static
address 192.168.XX.3
netmask 255.255.255.0
gateway 192.168.XX.1
dns-nameserver 192.168.XX.1

That also has the immutable bit set.

The only thing I see of any concern is that since the last reboot, 
ifconfig says there has been 946 overrun errors, but total traffic has 
been nearly 200 GB in the last 27 days 9 hours of uptime. For some 
installations thats likely miniscule.

Which is 100% correct? From the ambiguity and obtuseness of that man 
page, without any hint of a 'correct' example to be found it it, 
damnedifIknow.  All I do know is that it Just Works(TM).  And still does 
after changing it just now. And except for the router, not an active 
dhcpd on the property. Any machine can access any other local machine 
via ssh, or even sshfs, and any machine can fire up a browser and go net 
crawling.

Isn't that how its supposed to work?

Thanks Felix.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>