There are several nameserver entries in my /etc/resolv.conf, some public and some are my own:
search subdomain.example.com
nameserver 8.8.8.8
nameserver 10.20.30.1
nameserver 10.20.30.2
I want cURL to load a file from an address, that only my own DNS server can resolve:
curl subdomain.example.com/myfile
It fails with
curl: (6) Could not resolve host: subdomain.example.com
It looks to me like cURL tries the first nameserver and stops trying if that fails. I couldn't confirm though, because curl -v doesn't print what DNS server it uses.
So another question would be, how to determine which DNS server cURL uses by default, and ideally how to make it retry with the other entries from resolv.conf. I know the --dns-servers command line option. If possible, I'd prefer to use the DHCP provided DNS settings.