fix(isHostname): check for lengths

Check for DNS label and total hostname length in isHostname().