<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p><br>
</p>
<p>I'm trying to setup a domain migration using DNAME zones to keep
compat with previous domain name but I ended up with a solution
that works everytime with dig but seems to be randomly failing
using Linux GLIBC resolver.</p>
<p>Setup is PowerDNS running native *.domain.internal zones and
*.domain.local zones using DNAME to redirect to .internal. In
front of the PowerDNS server we're running DNSDist to route
internal authoritative zones and external ones to forwarders.<br>
</p>
<p>Here is that DIG finds out:</p>
<p>dig api.domain.local<br>
<br>
; <<>> DiG 9.16.27-Debian <<>>
api.domain.local<br>
;; global options: +cmd<br>
;; Got answer:<br>
;; WARNING: .local is reserved for Multicast DNS<br>
;; You are currently testing what happens when an mDNS query is
leaked to DNS<br>
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:
58530<br>
;; flags: qr aa rd; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL:
1<br>
;; WARNING: recursion requested but not available<br>
<br>
;; OPT PSEUDOSECTION:<br>
; EDNS: version: 0, flags:; udp: 1232<br>
;; QUESTION SECTION:<br>
;api.domain.local. IN A<br>
<br>
;; ANSWER SECTION:<br>
api.domain.local. 3600 IN CNAME
rp-int.dmz.domain.local.<br>
dmz.domain.local. 3600 IN DNAME
dmz.domain.internal.<br>
rp-int.dmz.domain.internal. 60 IN A 10.1.1.1<br>
rp-int.dmz.domain.local. 3600 IN CNAME
rp-int.dmz.domain.internal.<br>
<br>
;; Query time: 0 msec<br>
;; SERVER: 127.0.0.1#53(127.0.0.1)<br>
;; WHEN: Wed Apr 06 08:24:06 UTC 2022<br>
;; MSG SIZE rcvd: 139<br>
</p>
<p>It works 100% times.</p>
<p><br>
</p>
<p>However, getent host is failing a lot:</p>
<p>getent hosts api.domain.local</p>
<p>Using .internal domains also fails most of the time.</p>
<p><br>
</p>
<p>I'm seeing the same issue using Python socket module:</p>
<p>python3 -c 'import socket;
socket.gethostbyname("api.domain.local")'<br>
Traceback (most recent call last):<br>
File "<string>", line 1, in <module><br>
socket.gaierror: [Errno -2] Name or service not known<br>
</p>
<p><br>
</p>
<p>Any idea what's going on here, I'm completely lost. I guess my
DNAME usage is somehow incorrect but I don't understand why it's
working intermittently (and always with pure DNS call using
dig...)</p>
<p><br>
</p>
<p>Thanks a lot in advance,</p>
<p>Best regards, Adam.<br>
</p>
<p><br>
</p>
<div id="grammalecte_menu_main_button_shadow_host" style="width:
0px; height: 0px;"></div>
</body>
</html>