CLI: How can I get an IP address from a CIFS NETBIOS name?

Todd Chester 646 Reputation points
2021-10-15T19:54:40.62+00:00

Hi All,

Windows 10, pro and home

In Windows Explorer (not IE), when I click on Network in the left column, I get a list of computer CIFS broadcast names in the right pane. Well, after a bit.

I know how to add the IP column in Windows explorer, but ..

Is there a way to translate CIFS NETBIOS broadcast names into IP addresses from the command line?

Many thanks,
-T

Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,273 questions
0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Todd Chester 646 Reputation points
    2021-10-21T23:49:28.347+00:00

    I am the network administrator.

    The DHCP server is not linked to the DNS because it does not need to be for a workgroup. The dhcp server resides in a Watchguard firewall. It only does pass through DNS, not local DNS.

    The server is NOT a Windows server. It is Samba (Fedora). Windows servers are too buggy, slow, and expensive to administer. Samba is set and forget.

    I did find the duplicate machine name with arp. It was the ONLY workstation I did not configure myself.
    My question is how to I duplicate what Windows Explorer does with WDS from the command line.

    0 comments No comments

  2. MotoX80 31,581 Reputation points
    2021-10-22T00:19:03.43+00:00

    The DHCP server is not linked to the DNS because it does not need to be for a workgroup. The dhcp server resides in a Watchguard firewall. It only does pass through DNS, not local DNS.

    Again, why not? If you want machines on your local network to "see" each other, then use DNS!

    The server is NOT a Windows server. It is Samba (Fedora). Windows servers are too buggy, slow, and expensive to administer. Samba is set and forget.

    Well then maybe you should be asking this question in a Samba forum.

    I did find the duplicate machine name with arp. It was the ONLY workstation I did not configure myself.
    My question is how to I duplicate what Windows Explorer does with WDS from the command line.

    I don't know. I can't find a solution for you. Maybe some other other forum user can help you. As I see it, the correct solution is to use DNS. But you have not explained why that is not a viable solution.


  3. Todd Chester 646 Reputation points
    2021-10-22T01:25:43.16+00:00

    If you don't know of a command line tool and you don't know how Windows Explorer calls WDS, then please do not waste your time on alternate solutions. I do very much appreciate your help, but please do stay on subject.

    0 comments No comments

  4. MotoX80 31,581 Reputation points
    2021-10-22T21:38:15.133+00:00

    See if this Powershell script works for you.

    $MyNet = "192.168.1.*"       # Your subnet      
    $neighbors = (Get-NetNeighbor -AddressFamily IPv4 | Where-Object {($_.IPAddress -like $MyNet) }).IPAddress 
    "{0} neighbors were found" -f $neighbors.count
    $rpt = foreach ($ip in $neighbors) {
        $name = Resolve-DnsName $ip -LlmnrNetbiosOnly -ErrorAction SilentlyContinue -QuickTimeout
        if ($name) {
            [PSCustomObject]@{
                 IP        = $ip 
                 Name      = $name.namehost
            }
        }
    }
    $rpt
    

  5. Todd Chester 646 Reputation points
    2021-10-22T23:15:59.377+00:00

    I forgot to change the subnet. It found two of the five, but never itself from W10 and W11. W7 does not respond to WDS, but showed up on Windows explorer as netbios but only on the W7 machine. Fedora 33 should be dead quiet. Samba server was always found (wsdd server).

    0 comments No comments