I must write a C/C++ program which works a little bit like dig and nslookup: it must know IP addresses of any site. It should do things like the dig www.example.com MX +short command does. I can't imagine how can this be done. Any ideas?
Asked
Active
Viewed 6,371 times
1
-
Windows, Linux, MacOS ? Antway, its called resolving host name to IP address... – Tutankhamen Sep 08 '12 at 04:52
-
Check this thread: http://stackoverflow.com/questions/2151854/c-resolve-a-host-ip-address-from-a-url – Tutankhamen Sep 08 '12 at 04:59
-
@Tutankhamen: He needs to parse MX records – David Schwartz Sep 08 '12 at 05:04
1 Answers
2
Use any resolver library you like. Popular libraries include UDNS and adns. You could also just modify the source code to dig
(which is part of the bind distribution).

David Schwartz
- 179,497
- 17
- 214
- 278