I have a multi-IP addresses Server, a main IP 102.1.1.1 and a C segment 103.1.1.0/24 IP addresses on it.
when I use
wget www.google.com
can I assign my special ip address in my Server like ping
?
if can not, why?
I have a multi-IP addresses Server, a main IP 102.1.1.1 and a C segment 103.1.1.0/24 IP addresses on it.
when I use
wget www.google.com
can I assign my special ip address in my Server like ping
?
if can not, why?
There is an option to force wget
to use a specific address on the local host:
--bind-address=ADDRESS
So you would do something like that:
wget www.google.com --bind-address=102.1.1.1
You can use --bind-address=ADDRESS (for example
wget https://www.example.com/ --bind-address=123.123.123.123
Or add IP and Domain to file /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
123.123.123.123 www.example.com
This file check before DNS Server, if you assign an IP to a Domain, your domain will be resolve from that IP address and no matter what DNS is.