NSLookup resolves to local DNS, but browser resolves to public

1,517

The difference between nslookup and your browser / ping test is that nslookup will force a DNS lookup, whereas the other tests will will use the normal name resolution lookup order to resolve names.

This involves looking in the DNS cache, as well as static records in the hosts file. It's possible that your computers have static records for your webserver in the hosts file (Windows: C:\windows\system32\drivers\etc\hosts, Linux: /etc/hosts/ ). If a record is in this file then that record will be used, and a DNS lookup will not be performed.

As Zoredache suggested, it may also be a proxy server - as the proxy server will be performing DNS lookups on your behalf (Which will more than likely resolve the public address). That being said, ICMP is not usually proxied - especially in windows, but it's definitely worth investigating regardless.

If you want to troubleshoot - I suggest checking your hosts file, checking the proxy server settings, and if you're still drawing a blank, then flush your DNS cache (Windows: ipconfig /flushdns Linux: /etc/rc.d/init.d/nscd restart) and then run a program like wireshark or tcpdump to determine if your PC is actually sending a DNS request when you do a ping / browser test.

Share:
1,517

Related videos on Youtube

PeteSE4
Author by

PeteSE4

Updated on September 18, 2022

Comments

  • PeteSE4
    PeteSE4 almost 2 years

    I'm migrating from Google Maps API to Apple MapKit JS for the simple reason I have a developer account with them and they offer more free hits.

    Anyway, actual examples of MapKit JS are a bit thin (or at least Google isn't finding them - draw what conspiracy theories you will), so although I've got the basics going of displaying an embeded map, I can't seem to do the next step which is route between two points (Apple's documentation also seems impenetrable as they don't show examples).

    Here's my script for a basic map:

    <script>
        mapkit.init({
            authorizationCallback: function(done) {
            done('[MY-TOKEN]');
            }
        });
    
        var MarkerAnnotation = mapkit.MarkerAnnotation
        var myMarker = new mapkit.Coordinate(55.9496320, -3.1866360)
        var myRegion = new mapkit.CoordinateRegion(
            new mapkit.Coordinate(55.9496320, -3.1866360),
            new mapkit.CoordinateSpan(0.003, 0.003)
        );
        var map = new mapkit.Map("map");    
        var myAnnotation = new MarkerAnnotation(myMarker, { color: "#9b6bcc", title: "theSpace On The Mile"});
        map.showItems([myAnnotation]);  
        map.region = myRegion;
    </script>
    

    Now I want to:

    • Show a walking route between two points

    • Include waypoints on the route

    Could someone show the code that would achieve this? Once I can see an example I know I'll get it ;-)

    • Zoredache
      Zoredache over 10 years
      Do you have a proxy server configured in your browser? If your browsers are configured to use a proxy server, then DNS isn't performed on the local machine, the proxy server does the DNS resolution.
    • Napster_X
      Napster_X over 10 years
      Hi Zoredache, Just curious, will it be the case. I trust that even after configuring proxy, the resolution should be done by resolv.conf only, and shouldn't be done somewhere from outside.Though I haven't tested it and I am just saying this out of logic from my mind. Please correct me if I am wrong.
    • blacklight
      blacklight over 10 years
      @GeekRide, if the client is configured to use a HTTP proxy then it will send the HTTP request to the proxy server without doing any name resolution. The proxy server will then perform a DNS lookup and forward the return traffic to the client. There are other methods of proxy-ing traffic, but this is the most common.
    • Napster_X
      Napster_X over 10 years
      Thanx blacklight. I missed the part of HTTP proxy, as I always used the SOCKS one. thanx again for clarifying.
    • Concordus Applications
      Concordus Applications over 10 years
      We do not use a proxy.
  • Concordus Applications
    Concordus Applications over 10 years
    Nothing in the static hosts files. No proxy, but it looks like there was a caching issue. Each device we had to flush cache AND renew the DHCP lease. Working now. Thanks!