in reply to Syntactically check domain name/IP

Conways module Regex::Common has a regex for IP addresses.