1

I want to send a dns request through gethostbyname() and want to store resolved IP and TTL value in dns response through c or c++ code.

Can someone please suggest me any code . I am getting resolved IP throught gethostbyname() system calls. But don't know, how to get correspondig TTL value also.

1 Answers1

0

I suggest you use dns protocol directly to resolve hostname to ip. the response of the dns request contains ttl field.

Xing Fei
  • 287
  • 1
  • 6