Replace/cleanup DNS hostname validators
I noticed that the validators for DNS entries are different for most forms. Sometimes * is allowed, sometimes _, sometimes none. Often it can result in invalid entries: _ is only allowed at the beginning, - only in the middle of a label.
I think this should be a good validator:
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^(\*|(\*\.)?_?([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\._?([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*\.?)$/',
',
'errmsg'=> 'name_error_regex'),
It allows corner cases, e.g.: * *._asdf._asdf (currently not possible for TXT) asdf.example.com.
but disallows the following invalid records which can currently be entered e.g.: -asdf asd_f asdf*