Tutorial by Examples

The easiest way to connect via curl to a different server is to alter the hosts file on your machine. On Linux and Unix systems, the hosts file is located in /etc/hosts, while on Windows systems it will be located in c:\windows\system32\drivers\etc\hosts. Once you open the file with a text editor ...
The most effective way to resolve curl to a different server is to use the --resolve option. This option will insert the address into curl's DNS cache, so it will effectively make curl believe that's the address it got when it resolved the name. Like so: curl --resolve eaxmple.com:80:1.2.3.4 http:...
The "Host:" header is a normal way an HTTP client tells the HTTP server which server it speaks to. By passing custom modified "Host:" header you can have the server respond with the content of the site, even if you didn't actually connect to the host name. For example, if you ha...

Page 1 of 1