How to bypass hosts file

  • Thread starter Fakhar S via DotNetMonster.com
  • Start date
F

Fakhar S via DotNetMonster.com

Hello,

I need an urgent help here. I would like to write a code where I can bypass
the hosts file entries while contacting the web server directly. I also want
to get the list of IP addresses the for that domain. getHostByName function
serves the purpose but it reads the address from hosts file. Can I do it
through sockets or is there any other way to do it ?
 
V

Vadym Stetsyak

AFAIK Dns class uses system network settings and if there is not dns server
specified, it will try to search first in the hosts file.

Also I didn't find any property to specify what dns server to use...

If you want to query specific dns server for the host info you'll have to do
that manually. DNS protocol specs are here www.dns.net/dnsrd/rfc/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top