• # man gethostbyname

    Posté par . En réponse au message Avoir le host d'une url. Évalué à 1.

    Extrait du man gethostbyname


    #include <netdb.h>
    extern int h_errno;
    struct hostent *gethostbyname(const char *name);
    #include <sys/socket.h> /* pour avoir AF_INET */
    struct hostent *gethostbyaddr(const char *addr,
    int len, int type);


    Sinon, dans les deux sens, depuis le shell, tu utilises tout simplement :

    $ host