<div dir="ltr"><div class="" itemprop="text">
<p>Hi,<br></p><p>I am facing problem while querying DNS using getaddrinfo() API under a
process initiated by systemd. Despite having nameserver entry in
/etc/resolv.conf, the query fails to resolve. After few system call
traces, it is found that the problem is due to systemd resolution. It
seems like, for a process inited by systemd, the getaddrinfo() DNS query
routed via systemd while in stand alone mode (i.e. spawned by shell),
the query happens normally. I changed the /etc/systemd/resolved.conf to
add my DNS address and restarted systemd-resolved. Now the DNS query
works properly.</p>
<p>Is there anyway to bypass systemd for getaddrinfo() [ex: passing extra flags to hints], and get the work done in usual way?</p><p><br></p><p>In my case /etc/resolv.conf is softlink to runtime resolved.conf of systemd. Will unlinking and keeping the /etc/resolv.conf independent will solve the solution?<br></p><p><br></p><p>Regards,</p><p>Nandakumar<br></p>
</div></div>