I need to a little program in C++ that takes the type and hostname as commandline parameters and then makes the DNS lookup. For example:
DNSapp AAAA www.google.com
gethostbyname is obsolete, use
A / AAAA lookups.
SRV etc I recommend
ldns, or the related
libunbound. The latter is a full resolver in a library.
You could also just use
res_search from the Linux standard library.