/etc/hosts file allows us to specify an ip address for a domain.
For example, if the content of /etc/hosts file looks like this:
127.0.0.1 www.mydomain.com
It means that www.mydomain.com represents 127.0.0.1 when you type www.mydomain.com in the browser URL bar.
Is it possible to specify a domain for an ip address when sending requests with http.get() without modifying /etc/hosts?
I work on a public ubuntu machine where many people get access to /etc/hosts file. So it's best not to modify /etc/hosts.
The options parameter does not support this feature.
And I don't want to use hostile because it changes /etc/hosts.