Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 712717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:52:44+00:00 2026-05-14T04:52:44+00:00

I have an application I have been working on and it can be slow

  • 0

I have an application I have been working on and it can be slow to start when my ISP is down because of DNS. My ISP was down for 3 hours yesterday, so I didn’t think much about this piece of code I had added, until I found that it is always slow to start. This code is supposed to return your IP address and my reading of the link suggests that should be immediate, but it isn’t, at least on my machine.

Oh, and yesterday before the internet went down, I upgraded (oymoron) to XP SP3, and have had other problems.

So my questions / request:

  1. Am I doing this right?
  2. If you run this on your machine does it take 39 seconds to return your IP address? It does on mine.

One other note, I did a packet capture and the first request did NOT go on the wire, but the second did, and was answered quickly. So the question is what happened in XP SP3 that I am missing, besides a brain.

One last note. If I resolve a FQDN all is well.

Public Class Form1

'http://msdn.microsoft.com/en-us/library/system.net.dns.gethostaddresses.aspx
'
'excerpt
'The GetHostAddresses method queries a DNS server 
'for the IP addresses associated with a host name.
'
'If hostNameOrAddress is an IP address, this address 
'is returned without querying the DNS server.
'
'When an empty string is passed as the host name, 
'this method returns the IPv4 addresses of the local host 

Private Sub Button1_Click(ByVal sender As System.Object, _
                          ByVal e As System.EventArgs) Handles Button1.Click

    Dim stpw As New Stopwatch
    stpw.Reset()
    stpw.Start()
    'originally Dns.GetHostEntry, but slow also 
    Dim myIPs() As System.Net.IPAddress = System.Net.Dns.GetHostAddresses("")
    stpw.Stop()

    Debug.WriteLine("'" & stpw.Elapsed.TotalSeconds)
    If myIPs.Length > 0 Then Debug.WriteLine("'" & myIPs(0).ToString)
    'debug
    '39.8990525
    '192.168.1.2

    stpw.Reset()
    stpw.Start()
    'originally Dns.GetHostEntry, but slow also 
    myIPs = System.Net.Dns.GetHostAddresses("www.vbforums.com")
    stpw.Stop()

    Debug.WriteLine("'" & stpw.Elapsed.TotalSeconds)
    If myIPs.Length > 0 Then Debug.WriteLine("'" & myIPs(0).ToString)
    'debug
    '0.042212
    '63.236.73.220
End Sub

End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:52:44+00:00Added an answer on May 14, 2026 at 4:52 am

    See post #7 here Fix

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one web application which I have been working for some time.I am
I have been working on a large java application. It is quite parallel, and
I have been working on this application that enables user to log in into
I have been working on a facebook application which will be using Graph API
I have been working with iPhone application in which i am using sqlite database.
I have been working on a BlackBerry application that consumes web services from ColdFusion
I have been working on an application which allows the user to make a
I have been working on facebook application and you know on facebook native javascript
I have been working on mvc3 application and trying to localize the same. I
I have been working on a new installation of a Zend Framework application for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.