I couldn’t get the inbuilt DNS lookup to work when using TCP Client on a very slow internet connection, so i ported the arduino ethernet library.
May also be useful if you want to specify your own DNS server. Ive included a very simple example code, change the hostname to what you want to look up and it will tell you the IP address.
Its available here. https://github.com/Hootie81/DNSClient