Gethostbyname API, any relation to netbios?

Posted on 2006-05-12
Last Modified: 2013-11-13
can someone tell me if this has dependencies on netbios?

Reason I ask, is because I want to disable netbios over tcp/ip on one of our machines. However, we run 3rd party medical software on this machine.

The manufacturer of the medical software says they use gethostbyname in their software. But I can't totally trust them, they always give inconsistent answers.

So does gethostbyname have any relation to netbios?

Question by:dissolved
    LVL 32

    Assisted Solution

    The gethostbyname API is part of the WINSOCK interface and is not related to NETBIOS at all.  The dependencies in Windows name resolution flow the other way.  NetBIOS is dependent on TCP/IP, at least in Windows XP.

    NetBIOS comes into play with the WIN32 API functions like GetComputerName() and GetComputerNameEx().
    LVL 32

    Assisted Solution

    Oh, I forgot to mention, gethostbyname() ends up being resolved by DNS or the local computer's HOSTS file.
    LVL 8

    Accepted Solution

    gethostbyname() will use NetBIOS only as a last resort, it will try to resolve computer names in the following order:

    1. Check the local host name for a matching name.
    2. Check the Hosts file for a matching name entry.
    3. If a DNS server is configured, query it.
    4. If no match is found, attempt NetBIOS name-resolution.

    However, if you are running versions of windows earlier than 2000 then it can cause a few problems, as they wont be able to browse the network or access file shares etc.. (even with 2k it needs some configuring to register on local DNS servers)

    It is easier to get around this if you are on a domain and using Active Directory..

    see this link for more info:

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    This is about my first experience with programming Arduino.
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now