3

I have a webpage on a device that is access only by IP address, not by a domain name (e.g. 172.16.4.33). The page performs a few ajax calls to the same server, and I noticed in firebug some of these calls show a non-zero DNS lookup time.

If no domain name needs to be translated into an IP address, why is any time taken for DNS lookup at all?

3
  • This sometimes occurs if the IP address is entered in such a way that the application doesn't immediately recognise it as such and treats it as a string which needs to be looked up. Commented Jul 20, 2011 at 3:08
  • @John Not sure what that means, or how one enters an IP address as a URL not as a string, but all these ajax calls are using page-relative URLs. Commented Jul 21, 2011 at 17:21
  • test this by temporarily changing the relative URLs as absolutes and let us know the results. Commented Jul 21, 2011 at 22:06

2 Answers 2

4

There could be links in the page that point to domain names, or there might be reverse lookups happening.

1
  • There are links to hosted js and css, but the timeline I'm concerned about is specifically for an ajax call to the current page's server that shows DNS lookup times up to 250ms. I'm not sure how a reverse DNS lookup would get in there. I guess that would be jQuery doing way more than requested, which is possible. Commented Jul 21, 2011 at 17:24
-1

Add the IP in question to the /etc/hosts file on any/all machines that will be accessing it. At minimum it would eliminate any dns lookup overhead.

3
  • 1
    The use of the hosts file creates an ongoing maintenance issue and should only very rarely be required. It also wouldn't help in this case because the hosts file won't even be used. Commented Jul 20, 2011 at 3:06
  • that's arbitrary. the 172.16.x.x range is private IP space; unless he's running his own internal private dns, it needs to be added to the hosts file to mitigate failed dns lookups for unmapped space. the hosts file is not implicitly a maintenance issue - it entirely depends on the scope of the infrastructure.
    – anastrophe
    Commented Jul 20, 2011 at 20:39
  • let me rephrase - 'it may help to add it to the /etc/hosts file'. the need is not established.
    – anastrophe
    Commented Jul 20, 2011 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .