Original Post
Hi, i''m writing a mail program, and i need to do a DNS lookup for MX. I know DNS is UDP port 53, but is there a way to make it more reliable? At the moment it dies at recvfrom() sometimes, it just freezes. I''ve never used UDP before, and i''m using someone elses code. I''m guessing that it freezes because the data is never recieved (because UDP is unreliable).
Do i have to setup winsock to only wait for a short time (10 seconds or so) before re-sending the DNS request, or am i able to cheat somehow (is there an equivalent for gethostbyname() for MX records, or can i use TCP/IP)?
Thanks for any replies.