One of my my domains (lets say hackedd.nl) has a catch-all CNAME record pointing to hackedd.nl, which has both A and AAAA records. This all seems to work fine.
However, if the /etc/resolv.conf file on my server has a line specifying search hackedd.nl
, the resolver seems to prefer the IPv6 CNAME over an actual IPv4 A reply for servers that don't have an IPv6 address. For example:
curl -vsI http://security.ubuntu.com/ >/dev/null
* About to connect() to security.ubuntu.com port 80 (#0)
* Trying 2a02:2770::21a:4aff:fecb:a0f8... connected
Where 2a02:2770::21a:4aff:fecb:a0f8 is the server's own IPv6 Address...
Is there any way to make the resolver try IPv4 before trying the search list?