api for hosts / lmhosts

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

Does Windows API or .NET API offer any methods related to querying the
mappings present in HOSTS or LMHOSTS file ?
 
Does Windows API or .NET API offer any methods related to querying the
mappings present in HOSTS or LMHOSTS file ?

You shouldn't ever need to. Any time you do something that results in
a DNS name resolution (such as WebRequest.Create() with a domain
name), the OS itself will consult the hosts file, and similarly, every
time there is a NetBIOS name resolution (such as File.Open() with an
UNC path), the OS will consult lmhosts.
 

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

Back
Top