This content originally appeared on Bram.us and was authored by Bramus!
It’s possible to force DNS resolving in cURL using the --resolve
switch.
The
--resolve
switch allows you to tell curl which address to request when it would resolve a given hostname.
The format of the argument is domain:port:ip
# HTTPS Example
curl -I -L https://domain.example.org/ \
--resolve domain.example.org:443:192.168.0.1
# HTTP Example
curl -I -L http://domain.example.org/ \
--resolve domain.example.org:80:192.168.0.1
Handy for testing a new server or load balancer you’ve prepared, or when wanting to bypass Cloudflare Proxying without touching Cloudflare’s settings.
~
Thank me with a coffee.
I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!
To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.
This content originally appeared on Bram.us and was authored by Bramus!
Bramus! | Sciencx (2022-02-10T20:07:34+00:00) Force DNS resolving in cURL with the –resolve switch. Retrieved from https://www.scien.cx/2022/02/10/force-dns-resolving-in-curl-with-the-resolve-switch/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.