I am working on remote sandbox with ip 190.34.24.56 (not real ip, just for example)
Hosts file contains this string:
190.34.24.56 web.sandbox.com
I have access to url web.sandbox.com from browser, but when try to send http request I get an error: ENOTFOUND (domain name not found).
How to send http request from nodejs to url which not have dns record? (I can't enter to sandbox using 190.34.24.56, because there is host-server works which determine incoming url and redirects request to other port, so I can use only web.sandbox.com)
I haven't actually tried this, but you could try passing in the domain header along with your request:
Host: yourhostname.com
See full list of HTTP headers: List of HTTP header fields