Introduction
There might be times when you need to send a curl request to a specific server but do this with a custom hostname mapping. For example, let’s say your application does a different thing depending on the hostname and a request to the application with a different hostname will result in a different response. This can be tested by using the following command:
curl "https://api.samueltambunan.com/d/example.mp3" -v -o test2.mp3 --resolve api.samueltambunan.com:443:144.33.22.11
The above will send a GET request to the URL, but instead of resolving the hostname using the DNS, the IP address 144.33.22.11
is used instead.