Pascal
Pascal

Reputation: 21

How do i prevent the browser from making expensive DNS lookups?

Almost every ajax call I make, results in an expensive DNS look up. Are there headers I can set, that will prevent the browser from making DNS look ups. Or perhaps some server side settings?

Upvotes: 1

Views: 593

Answers (3)

user330315
user330315

Reputation:

You could add the hostname/IP mapping in question to your hosts file (on the computer where the browser is running).

The exact location depends on the operating system. On a 32bit Windows system this is %windir%\system32\drivers\hosts, on Unix like systems this should be /etc/hosts

As far as I know, no DNS lookup will happen for entries in the hosts file (at least not on Windows)

Upvotes: 0

anon
anon

Reputation: 4608

How do you know that this is causing a performance problem? Did you use Wireshark to verify? I very much doubt that DNS lookups are to blame.

Upvotes: 1

Toby Allen
Toby Allen

Reputation: 11213

Using the IP Address should prevent DNS Lookup :)

Upvotes: 0

Related Questions