Samba and GetHostByName API call - SMB

This is a discussion on Samba and GetHostByName API call - SMB ; Hi, I use the Win32 Api call GetHostByName to get the IP adress of the server where my application is stored. But One of our customers is using a Linux server with Samba. The function call returns the IP adress ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Samba and GetHostByName API call

  1. Samba and GetHostByName API call

    Hi,

    I use the Win32 Api call GetHostByName to get the IP adress of the server
    where my application is stored. But One of our customers is using a Linux
    server with Samba. The function call returns the IP adress of the client!

    Does someone knows if the call should work properly? Maybe some
    configuration error?

    Martijn van der Kooij



  2. Re: Samba and GetHostByName API call

    Martijn van der Kooij wrote:

    > Hi,
    >
    > I use the Win32 Api call GetHostByName to get the IP adress of the server
    > where my application is stored. But One of our customers is using a Linux
    > server with Samba. The function call returns the IP adress of the client!
    >
    > Does someone knows if the call should work properly? Maybe some
    > configuration error?
    >
    > Martijn van der Kooij
    >


    Martijn,

    By default Linux doesn't consult it's NetBIOS services when performing
    name resolution.

    I haven't done it, but my understanding is that you can run the winbindd
    daemon, then just configure your /etc/nsswitch.conf file to include this
    line:

    hosts: files winbind dns

    Definitely read the man pages on winbindd and nsswitch.conf though,
    since I've never done it.


  3. Re: Samba and GetHostByName API call

    > > I use the Win32 Api call GetHostByName to get the IP adress of the
    server
    > > where my application is stored. But One of our customers is using a

    Linux
    > > server with Samba. The function call returns the IP adress of the

    client!
    > >
    > > Does someone knows if the call should work properly? Maybe some
    > > configuration error?
    > >

    >
    > By default Linux doesn't consult it's NetBIOS services when performing
    > name resolution.
    >
    > I haven't done it, but my understanding is that you can run the winbindd
    > daemon, then just configure your /etc/nsswitch.conf file to include this
    > line:
    >
    > hosts: files winbind dns
    >
    > Definitely read the man pages on winbindd and nsswitch.conf though,
    > since I've never done it.
    >


    Thanks, I never touched Samba myself, i'm just getting reports from a
    customer, I will take a look at this information and send it to him.



+ Reply to Thread