cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Using cURL to check multi hosted sites ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 7 Dec 2011 22:59:47 +0100 (CET)

On Wed, 7 Dec 2011, curl-mailinglist_at_courbis.com wrote:

> Is there an option in cURL to force a connexion to a specific IP, regardless
> the DNS resolution (this could be also used to test a new webserver before
> making the DNS settings)

Sure, there are at least two different ones:

1. Use --header and provide a custom "Host:" header like

   curl http://1.2.3.4/ -H "Host: my.site.com"

2. Use --resolve to add "fake" host entries:

   curl http://my.site.com/ --resolve my.site.com:80:1.2.3.4

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-07