curl で host 指定する
host 指定したい
冗長構成のサーバーを IP 指定したいなー、という時は DNS サーバー(仮) の hosts ファイルでルーティングの設定入れると思います。
$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
172.16.1.1 example.qiita.com # example.qiita.com にアクセスしたらこの IP ですよという設定
hosts ファイルは即時反映されます。
curl でどうやるか?
--resolve オプション
付ければできました。
$ curl --resolve example.qiita.com:443:172.16.1.1 https://example.qiita.com
Author And Source
この問題について(curl で host 指定する), 我々は、より多くの情報をここで見つけました https://qiita.com/att55/items/c0bd43a0863a159f5dc5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .