Can't ping network machines by hostname when behind wireless router on university network (only IP)

15,999

In Windows, hostname resolution is generally done using one of four methods:

  1. DNS – the most likely option. Your university's DHCP server provides you with DNS servers and with a default suffix that is automatically appended to all bare hostnames. For example, if you ping foobar, and the DHCP server gave you example.edu, Windows will try foobar.example.edu first.

  2. NBNS aka NetBIOS – this is an obsolete name resolution protocol using broadcasts. It does not work across routers, and it is highly unlikely that it is used in an university network.

  3. WINS – same as NBNS but using a central server. Obsolete in favor of DNS, but still used in some places due to relative simplicity.

  4. LLMNR – a newer Microsoft protocol using multicast packets. I don't know how to use it, but it's unlikely to be the cause, as only Windows Vista and 7 support it.

To find out whether DNS is being used, connect your computer directly to Ethernet, then run ping hostname. If you see "Pinging hostname.example.edu", then the name was resolved by DNS, and you have to use the "example.edu" suffix.

A better way to find out which protocol is in use is to run ipconfig/flushdns and nbtstat -R to flush the caches, start a Wireshark capture, and try pinging a valid hostname. (Again, must be connected directly to the Ethernet.)

When using your own DHCP server, you will have to manually configure Windows to use a DNS suffix. In Control Panel → Network and Sharing Center, click the Change adapter settings item. Right-click your network adapter, select Properties → TCP/IPv4 → Properties → Advanced → DNS, and update "DNS suffix for this connection". Alternatively, configure your router's DHCP server to give the correct suffix.

Share:
15,999

Related videos on Youtube

Milind Ganjoo
Author by

Milind Ganjoo

Updated on September 18, 2022

Comments

  • Milind Ganjoo
    Milind Ganjoo over 1 year

    I have a TP-LINK wireless router (TL-WR340G) that is connected to my university LAN via an Ethernet cable (which assigns a dynamic IP address to each device connected). My Windows 7 computer is behind this router.

    I often need to ping host names of other computers on the university network. Normally, when I'm directly connected to the LAN, I can do this (for example, ping foobar would return a normal response). However, when I am behind the wireless router and try to ping the same machine, I get no response ("Ping request could not find host..."). Pinging via IP still works, which leads me to believe it has something to do with the university DNS server. For now, I've fixed this problem by adding entries directly to my C:\Windows\System32\drivers\etc\hosts file.

    Maybe I'm guessing wrong, but could it have something to do with the DNS server rejecting the IP address of my computer (which is assigned by my wireless router's DHCP, instead of the university DHCP, as it would be if I were connected directly through Ethernet)?

    I'm wondering if there's a way I could route all requests from my computer through my wireless router in such a way that they all carry the router's assigned WAN IP address (which is basically the university LAN's dynamic IP)?


    UPDATE: Based on @grawity's suggestion below, I did a Wireshark capture while connected to Ethernet, and I discovered that the host name was being searched using NBNS, not DNS (more specifically, WINS, as a quick ipconfig /all on the Ethernet connection revealed. From Wireshark:

    7725    25.952920   (My IP)         (IP Addr of WINS)   NBNS    92  Name query NB FOOBAR<00>
    ...
    7729    25.956152   (IP Addr of WINS)   (My IP)         NBNS    104 Name query response NB (IP Addr of FOOBAR)
    

    And from ipconfig /all:

    Secondary WINS Server . . . . . . : <ip address 1>
    Primary WINS Server . . . . . . . : <ip address 2>
    NetBIOS over Tcpip. . . . . . . . : Enabled
    

    It doesn't look like my router supports setting a WINS server, so I just set it in the Wireless Network Connection properties instead.

    • ChrisF
      ChrisF over 12 years
      Have you talked to your university's IT department?
    • Milind Ganjoo
      Milind Ganjoo over 12 years
      That didn't really help, unfortunately, as they will support only those computers that are connected to the LAN directly using Ethernet. I'm trying this more from an experimental angle.
    • N4TKD
      N4TKD over 12 years
      Have you tried setting your IP address on the wireless router in the DMZ and/or turning of the firewall feature of the wireless router?
  • Milind Ganjoo
    Milind Ganjoo over 12 years
    Thanks @grawity, for pointing me in the right direction! Didn't think that the name resolution could be happening using WINS (doesn't that speak volumes about the cutting-edge IT infrastructure of my university? :) I've included updated information in the answer. While I don't think my router supports specification of the WINS server, this solution should suffice for now, till I get a better router.
  • Milind Ganjoo
    Milind Ganjoo over 12 years
    Thanks, though the DNS server was the first thing I checked. I set up manual DNS server IPs in my router, and it still wasn't working (until I discovered that the problem was with the WINS server, as above).