Ignore hosts file?

I need to call the Response.Redirect method with C #, but I need to do it in such a way that it ignores the Hosts for Windows file for this call?

For example, if on Hosts I:

127.0.0.1 google.com

and I call Response.Redirect ("google.com"), I need it to ignore the hosts for that one call only and actually go to google.com and not localhost. How can i do this?

I know I can call Response.Redirect to google ip address, but is there a better way?

+3
source share
3 answers

No, maybe not: DNS lookup is passed to your OS, which checks ... the hostsfile.

Ifff you can

  • find IP address without OS recognizer
  • IP- ( - http://10.15.6.4/some/path (Google Search IP , btw)),

.

+3

hosts - .

+2

If you can find out the IP address of a host without asking for the OS (for example, through a third-party side), then you actually ignored the host files.

0
source

Source: https://habr.com/ru/post/1755301/


All Articles