hi Adrian,
For 9.4.2+ you can use the steps in SOL8437:
SOL8437: Configuring BIG-IP to resolve DNS hostnames
https://support.f5.com/kb/en-us/solutions/public/8000/400/sol8437.html
For older versions, you can check SOL3624:
SOL3624: Configuring DNS name resolution
https://support.f5.com/kb/en-us/solutions/public/3000/600/sol3624.html
And here are a few examples of using NAME::lookup and validating the response:
http://devcentral.f5.com/wiki/default.aspx/iRules/DestinationSnatUsingDNS.html
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=31&tpage=1&view=topic&postid=8551885545
SOL5299: The BIG-IP system does not forward DNS requests after configuring the BIND Forwarder Server List
https://support.f5.com/kb/en-us/solutions/public/5000/200/sol5299.html
Aaron