Index: /trunk/DNSDB.pm
===================================================================
--- /trunk/DNSDB.pm	(revision 668)
+++ /trunk/DNSDB.pm	(revision 669)
@@ -653,4 +653,7 @@
     return ('FAIL', "CNAME records cannot point directly to an IP address")
       if ${$args{val}} =~ /^(?:[\d.]+|[0-9a-fA-F:]+)$/;
+
+    # Make sure target is a well-formed hostname
+    return ('FAIL', $errstr) if ! _check_hostname_form(${$args{val}}, ${$args{rectype}}, $args{defrec}, $args{revrec});
 
     # Forcibly append the domain name if the hostname being added does not end with the current domain name
