You can overrride the Name Resolution with specific IP address without adding the hostname to /etc/hosts file by using --resolve option.

Syntax :

--resolve <host:port:address>

It will resolve IP address when connect to host on port

Example :

This will connect

$ curl --resolve ""

But this won't connect, because we use 443 port for https

$ curl --resolve ""

For cover all ports, use * wildcard

$ curl --resolve*: ""