We have developed for the CODESYS environment an FB for the resolution of URL domain names by connecting to a DNS server. As can be seen fromextract of the manual a UDP socket is used to make the connection with the server.
I attach the source program of the example shown in the manual which, through a connection to the Google DNS server, requests the domain IP address elsist.