HectorOfTroy407 HectorOfTroy407 - 4 months ago 32
Linux Question

cURL --resolve issues

I am trying to make a cURL request that resolves to a specific IP. From everything I've read, this looks syntactically correct to me but I am still seeing the 'could not resolve host error'. Can someone point me in the right direction? I'm seeing a variety of errors:

curl —-resolve e-dinar.io:443:42.81.15.75 "https://e-dinar.io"
IDN support not present, can't parse Unicode domains
* getaddrinfo(3) failed for —-resolve:80

curl —-resolve e-dinar.io:443:42.81.15.75 "https://e-dinar.io:443"
curl: (6) Couldn't resolve host '—-resolve'
curl: (6) Couldn't resolve host 'e-dinar.io:443'

curl "https://e-dinar.io:443" —-resolve e-dinar.io:443:42.81.15.75
curl: (6) Couldn't resolve host '—-resolve'
curl: (6) Couldn't resolve host 'e-dinar.io:443'


Any thoughts where I am going wrong? Thanks.

Answer

You are using wrong - in the curl command (), change —- to --. You have a hint in curl response here:

curl: (6) Couldn't resolve host '—-resolve'

curl tries to get data from —-resolve host, it doesn't parse it as a command because of wrong -.

Comments