Mailinglist Archive: opensuse (958 mails)

< Previous Next >
Re: [opensuse] Paths of DNS Queries
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Wed, 01 May 2019 15:55:18 +0200
  • Message-id: <qac8g6$oee$1@saturn.local.net>
Anton Aylward wrote:

On 2019-05-01 7:47 a.m., Carlos E. R. wrote:
On 01/05/2019 13.22, Anton Aylward wrote:

Perhaps I didn't make myself clear.
When an application such as Firefox make a library call
"gethostbyname()" (or is that obsolete now?) what happens?

I may be wrong but I think the first thing that happens is that
there is a look-see to /etc/nsswitch.conf to see what should be
invoked. Mine says:
hosts: files dns
which, I take it, means check /etc/hosts first and then use the
configired DNS resolver if the address isn't found in the hosts
file.

Two things occur to me at this point.
The first is that dnsmasq slurps up /etc/hosts anyway so the 'files'
entry is redundant.

Before that point (before reading from /etc/hosts) is the nscd
intercept.

You mean that -- somehow, some unspecified manner -- that happens
before the decision as to whether to use files or DNS or something
else as determined by the nsswitch.conf file is accessed?

As I said, I'm using dnsmasq and NOT nscd.
The decision path still has to be there.

When an application calls getaddrinfo(), the first thing it does is
check with nscd over a unix socket. nscd is a standard part of libc.

I've found that dnsmasq wants to listen locally so there should be an
entry in the /etc/resolv.conf file of 127.0.0.1
Now I need to figure out how "gethostentrybyname()" ends up at
/etc/resolv.conf

That is done by the resolver library. If nscd is not available or has
no useful answer, the resolver continues by looking at nsswitch.ch,
then it proceeds according to that config.



--
Per Jessen, Zürich (16.9°C)
http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups