Linux / Unix: curl Command Pass Host Headers

The curl command can pass custom host headers using the -H option. For example, to pass a custom host header:

curl -H "Host: customhost.com" https://example.com

This is useful when testing or accessing websites that have multiple domain names pointing to the same IP address. The host header allows the server to determine which domain name was requested and respond with the appropriate content.

Leave a Comment