curl --resolve appears to do nothing

It appears that the address needs to be a numeric IP address, not a hostname.

Try this:

curl --resolve foo.example.com:443:127.0.0.1 https://foo.example.com:443/

Some additional help in troubleshooting:

Ensure you're listing the right port for the protocol: http=80; https=443 & etc.

Also curl -v will give the HEADER information for the response server which can be helpful.

$ curl -v --resolve foo.example.com:443:127.0.0.1 https://foo.example.com:443/
## The client request headers prepended by >
> OPTIONS /v1/..
> HOSTS foo.example.com
## The server response prepended by <
< HTTP/1.1 501 Not Implemented
## The html returned
<H1>Unsupported Request</H1>

Basically in this case the OPTIONS HTTP method was not implemented at the edge server for the CDN.

Tags:

Dns

Curl