0

I have a Linux Alpine (v3.18.6) container running on AKS. The curl command inside that container is not able to resolve a private DNS host. Also, nslookup throws SERVFAIL.

However, when I provide --ipv4 switch, it's able to resolve and connect (please see attached screenshot, note that I have masked the host in green and corresponding IP address in blue as I can't share the actual host URL information for privacy).

enter image description here

Below are the OS details along with Nodejs and curl versions:

enter image description here

My question is, why is curl not able to automatically use IPv4 address while connecting?

1 Answer 1

1

SERVFAIL is quite clear: instead of telling your client "no sorry, no such record", the DNS resolver asked replies with "sorry, I'm broken".

So, you need to fix that DNS resolver, not the client you're using.

The --ipv4 flag helping suggests it might be your name server's is broken when asked via IPv6, for whatever reason. Maybe check that.

4
  • but isn't curl supposed to automatically look for ipv4 when ipv6 doesn't work? Commented May 15, 2024 at 9:32
  • @SnehasishKarmakar for connecting to the target host – sure. But if the name server via IPv6 says "sorry, I'm failing at resolving your request", but responds, why would I try to use IPv4 to connect to the name server? Commented May 15, 2024 at 9:34
  • If the nameserver's connectivity is broken, then how is it able to resolve some other host's ipv6? nslookup google.com works fine. Also, the same host can be resolved using some other OS as the base image for the container (e.g. RHEL). Commented May 16, 2024 at 12:06
  • You're right, that's the point, the connectivity isn't broken, your nameserver is broken when asked via that Ipv6 connectivity. Fix the nameserver; end of story. Curl really has no influence on the SERVFAIL. Commented May 16, 2024 at 12:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.