Mailinglist Archive: opensuse (958 mails)

< Previous Next >
Re: [opensuse] Paths of DNS Queries
On 01/05/2019 13.22, Anton Aylward wrote:
On 2019-05-01 6:51 a.m., Carlos E. R. wrote:

The thing is, when an application makes a DNS query, what is the logical
path of
calls that it follows? There are just so many possibilities that come to
mind
"A guide for the perplexed" with a decision chart diagram, branching
mindmap or
something would be nice :-)

I guess the query is first answered or intercepted by nscd, then it goes
to the configured DNS. Ah, wait, first it goes to the host file, which I
think is cached by nscd.

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.


The second is I don't see how things get to dnsmasq.
Can someone help me here, please.

Sorry Carlos, "Intercepted' is just too vague a concept.
Somehow, somewhere there is a decision-in-software, an 'if" statement based
on a
config file entry, and not a beady-eyed raptor waiting to swoop down on an
unsuspecting rodent.

nscd is not in the "official" loop, IMHO, so instead it puts itself in
the middle intercepting some library calls and giving an answer without
the library reaching its designed goal of reading the hosts file or
querying a DNS.

I can not explain in detail because I do not know, I simply guess.


The getting to dnsmasq is the same thing as getting to bind, or getting
to the caching server in your router. No difference. It is just a DNS
server somewhere in the entire world, just that it happens to sit locally.



--
Cheers / Saludos,

Carlos E. R.

(from openSUSE, Leap 15.1 x86_64 (ssd-test))

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

< Previous Next >
List Navigation