How to get default Gateway address, subnet address, DNS names using C/C++ - Networking

This is a discussion on How to get default Gateway address, subnet address, DNS names using C/C++ - Networking ; Hi, Can any one please let me know that how to get IP address of the current machine, default gateway, DNS name , subnet address using C/C++ thanks Anup...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How to get default Gateway address, subnet address, DNS names using C/C++

  1. How to get default Gateway address, subnet address, DNS names using C/C++

    Hi,

    Can any one please let me know that how to get IP address of the
    current machine, default gateway, DNS name , subnet address using C/C++

    thanks
    Anup


  2. Re: How to get default Gateway address, subnet address, DNS names using C/C++

    Dear Matrixinline,

    You may take a look at netdb.h...

    There you can find some structs like:
    - servent
    - netent
    - hostent
    etc.

    There are several functions, which give you the desired infos:
    getnetbyaddr, getnetbyname

    Hop that hels a little bit.
    Johann

    Matrixinline wrote:

    > Hi,
    >
    > Can any one please let me know that how to get IP address of the
    > current machine, default gateway, DNS name , subnet address using C/C++
    >
    > thanks
    > Anup



  3. Re: How to get default Gateway address, subnet address, DNS names using C/C++

    HI horvatj,

    Thanks for the help but I do not get the default gateway
    names/addresses and DNS address from the functions available on the net
    library.

    -Anup


    horvatj wrote:
    > Dear Matrixinline,
    >
    > You may take a look at netdb.h...
    >
    > There you can find some structs like:
    > - servent
    > - netent
    > - hostent
    > etc.
    >
    > There are several functions, which give you the desired infos:
    > getnetbyaddr, getnetbyname
    >
    > Hop that hels a little bit.
    > Johann
    >
    > Matrixinline wrote:
    >
    > > Hi,
    > >
    > > Can any one please let me know that how to get IP address of the
    > > current machine, default gateway, DNS name , subnet address using C/C++
    > >
    > > thanks
    > > Anup



+ Reply to Thread