#ZegnatIf you want a walkthrough of the code, happy to provide. But basically the first two it's are if the host itself is an IP, and the last else is to resolve DNS otherwise. After establishing IP, uses build in validator of PHP to make sure those IPs are acceptable.