Mapping between domain NetBIOS name and DNS name ?

Christopher R. Hertel crh at
Fri Aug 8 07:33:16 GMT 2003

Yuquan Jiang wrote:
> Hi,
> Does anyone know how to lookup a domain's DNS name with its NetBIOS name ?
> And how to do the reverse?
> Thanks a lot.

When you say "domain" do you mean a DNS domain, a Windows NT domain or a
Windows 2000 Active Directory domain?  These are not the same things.

The answer to your question is probably here:

It is very important to understand how all this stuff fits together (and

That said...

If you have a NetBIOS name then you can resolve it to an IP address using
RFC1002 name queries.  You will need to know the node type (B, P, M, H) and
unless the node is a B node you'll need to know the address of the NBNS
(aka. WINS server).  Once you have the IP address of the node that
registered the NetBIOS name you can do a reverse lookup to find the DNS name
associated with the IP address.

If you're looking for an NT Domain name (instead of a DNS domain name) then
you can send an Adapter Status query to the IP address to see what other
NetBIOS names it has registered.  The NT Domain or Workgroup name will be
among them.  You can figure out which name in the list is the NT Domain or
Workgroup name by matching up the type (group vs. unique) and the suffix

All of this assumes that the node which registered the NetBIOS name is still
active.  If the name is no longer registered then you won't be able to find
the IP address and you won't be able to send an Adapter Status query.

Yes, it's complex.  You really do want to read the docs listed above. 

Chris -)-----

"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team --     -)-----   Christopher R. Hertel
jCIFS Team --   -)-----   ubiqx development, uninq.
ubiqx Team --     -)-----   crh at
OnLineBook --    -)-----   crh at

More information about the samba-technical mailing list