Results 1 to 6 of 6

Thread: [RESOLVED] Resolving domain IP. Strange behavior.

  1. #1

    Thread Starter
    Lively Member Luc L.'s Avatar
    Join Date
    Jan 2005
    Posts
    122

    Resolved [RESOLVED] Resolving domain IP. Strange behavior.

    Ok, I have a simple code to resolve IP address for a specified domain (please excuse the lack of error handling support, but this is a sample only):

    VB Code:
    1. Dim dns1 As Dns
    2.         Dim ips As IPHostEntry
    3.  
    4.         ips = dns1.Resolve("something.com")
    5.         MsgBox(ips.AddressList(0).ToString)

    Now, why is it that Internet explorer can resolve something.com and strange.com but that code returns and error indicating that the domain does not resolve?

    Thanks!
    Luc L.

  2. #2
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Resolving domain IP. Strange behavior.

    Try adding "http://" to the name. IE has built in functionality to assume that's what you meant, but VB.Net relies on you a little more. May or may not work?

  3. #3

    Thread Starter
    Lively Member Luc L.'s Avatar
    Join Date
    Jan 2005
    Posts
    122

    Re: Resolving domain IP. Strange behavior.

    i did that. it returns a different error as well.

  4. #4
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Resolving domain IP. Strange behavior.

    I got my IDE back, here's what I think you're after. (I was close )
    VB Code:
    1. Dim ips As Net.IPHostEntry
    2.         ips = Net.Dns.Resolve("www.something.com")
    3.  
    4.         MessageBox.Show(ips.AddressList(0).ToString)
    Sorry for the delay, I still need to buy Visual Studio for home use.

  5. #5

    Thread Starter
    Lively Member Luc L.'s Avatar
    Join Date
    Jan 2005
    Posts
    122

    Re: Resolving domain IP. Strange behavior.

    thanks steven. that worked great!

  6. #6
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: [RESOLVED] Resolving domain IP. Strange behavior.

    No problem Lucy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width