Mailinglist Archive: opensuse (958 mails)

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

On 2019-05-01 9:42 a.m., Per Jessen wrote:
Carlos E. R. wrote:

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.

It is the resolver library that asks nscd. It's perfectly "official".
nscd listens on /var/run/nscd/socket.

That makes, sense, sort of.
It clears up HOW to communicate with nscd.
But where do we get the reference to use /var/run/nscd/socket?

Well, we don't. That is the job of the resolver.

I understand listening on localhost:53
Its a 'well known' address.
I can even grok listening on *:53 when I'm in a generous mood.
But something has to refer to /var/run/nscd/socket
As opposed to some other socket
In order to talk to nscd via that oscket they have to have found the
address /var/run/nscd/socket somewhere. So WHERE?

It's hardcoded in libc. (no doubt configurable at build time)

I'm running dnsmasq not nscd but I find this interesting

They don't preclude oneanother, they actually complement each other.
nscd isn't necessary, but presumably does speed up things.

Now dnsmasq listens on the well known port 53 (and yes that's
configurable:
# grep -C 2 "53" /etc/dnsmasq.conf

# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
#port=5353
)

How do we get there?
Well the man pages for configuring dnsmasq say to set up
/etc/resolve.conf to have ONLY ONE entry:
nameserver 127.0.0.1

Yup. And that is exactly how you get there. You point the resolver to
the nameserver you wish to use.

Now nscd is a cache server and not a resolver. I can see setting
dnsmasq's own cache to zero and using nscd, but that seems a
bit complicated. And if that were to be done, it still doesn't clear
up a few HOW.

nscd caches hosts, i.e. A and AAAA records, for apps using e.g.
getaddrinfo(), nothing else. Any app doing direct dns lookups will be
cached by dnsmasq, according to DNS ttl values.

For email & web browsing, caching addresses makes sense - to a degree.
but how much does the application do the caching?

Any sensible application will leave the majority of cacheing to the
system. In your code you might cache for the duration of a loop or a
session, but otherwise you just do the lookup again.

Realistically, my Thunderbird needs to cache
imap.mail.antonaylward.com
smtp.mail.antonaylward.com
That's the theory. Actually its all one "mail.antonaylward.com"
imap.gmail.com
smtp.gmail.com

Your Thunderbird should be doing a lookup every time it needs one of
those. If it caches, any round-robin'ing will be negated, for
instance.



--
Per Jessen, Zürich (18.7°C)
http://www.dns24.ch/ - your free DNS host, 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