Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I looled for a way of queriying an MX record of a particular domain. After googling with different keyword, I found the article "E-mail Architecture part II" ( http://www.linuxforums.org/network/e...e_part_ii.html ...
  1. #1
    Just Joined! Hand$hake's Avatar
    Join Date
    Aug 2008
    Location
    Paris, France
    Posts
    2

    Smile DNS MX Query in C

    Hi,

    I looled for a way of queriying an MX record of a particular domain.
    After googling with different keyword, I found the article "E-mail Architecture part II" ( http://www.linuxforums.org/network/e...e_part_ii.html )

    I tried to compile the code with gcc without modifiying it, and I have the following error message:
    Code:
    gcc mx.c 
    /tmp/ccglAdMp.o: In function `getmxip':
    mx.c:(.text+0x109): undefined reference to `__res_query'
    mx.c:(.text+0x221): undefined reference to `__dn_skipname'
    mx.c:(.text+0x2b9): undefined reference to `__dn_expand'
    mx.c:(.text+0x3ab): undefined reference to `__dn_expand'
    Is there another library to include to use these functions ?

    Thanks

  2. #2
    Just Joined! Hand$hake's Avatar
    Join Date
    Aug 2008
    Location
    Paris, France
    Posts
    2
    I found the solution: I just had to compile with -lresolv option.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...