How to resolve local domain name?

If the machines on your LAN run a relatively modern operating system, then you can access them by appending ".local" to their host name, like this :

ping MACHINE_NAME.local

To get the name from a given IP, use

avahi-resolve-address MACHINE_IP

To see all connected machine names and IPs on the local network, use something like this BASH command :

px-lan-scan () {
    LOCAL_MASK=$(ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}' | cut -d. -f1,2,3)
    GATEWAY=$(route -n | \grep '^0.0.0.0' | awk '{print $2}')
    if [ $1 ] ; then range=$1 ; else range="10" ; fi

    for num in $(seq 1 ${range}) ; do
        IP=$LOCAL_MASK.$num
        if [[ $IP == $GATEWAY ]] ; then MACHINE="gateway" ; else MACHINE=$(avahi-resolve-address $IP 2>/dev/null | sed -e :a -e "s/$IP//g;s/\.[^>]*$//g;s/^[ \t]*//") ; fi
        ping -c 1 $IP>/dev/null
        if [ $? -eq 0 ] ; then
            echo -e "UP    $IP \t ($MACHINE)" ; else
            echo -e "DOWN  $IP"
        fi
    done
}

In general the router won't act as a DNS server but they'll often act as a DNS proxy. That is, in DHCP they'll give out their own IP as the DNS server and then they'll turn around and hit the real DNS servers. If it's doing this then I'd think you could resolve those local, .belkin, names.

Check ipconfig /all and see if the Default Gateway and DHCP Server have the same IP. If not then enter nslookup, then enter "server ROUTER_IP" at the prompt and try to do a lookup on google.com. If that works then there's probably a setting in the router to have it give it's own IP as the DNS server that's not checked.

Tags:

Networking