emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous DNS resolving


From: Lars Ingebrigtsen
Subject: Re: Asynchronous DNS resolving
Date: Sun, 15 Feb 2015 16:31:39 +1100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Lars Ingebrigtsen <address@hidden> writes:

> Eli Zaretskii <address@hidden> writes:
>
>> Can't you simulate async resolution with timers?  Or even by opening a
>> network-process to the DNS server and talking to it directly (which
>> can be done asynchronously with filters and sentinels and stuff)?
>
> That's what dns.el does, but it suffers from not having access to
> OS-level funky stuff like possible local caching, and the general
> difficulty of getting at the current DNS setup on modern machines.
>
> Using the C-level resolution functions is the safest best, since libc is
> really the authority here...

Although using getaddrinfo_a is best, a thought just occurred to me: The
main problem with dns.el is that it's not very good at getting the IP
address of the domain name server it's supposed to talk to.  (Talking
DNS itself is really easy.)

So if we added a `get-domain-name-server-addresses' C-level function, dns.el
could use that, and it'd work more reliably.  (That function would
basically just call res_init and then return the list of IP addresses.)

dns.el is currently mostly used to do reverse resolving of IP addresses
for display purposes in Gnus, so this would be a win even if we don't
use dns.el for forward resolution.  (But we could on systems without
getaddrinfo_a, if we wanted.)

Would anybody mind if I add the `get-domain-name-server-addresses'
function?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]