| Previous | Next |
| DNS_ERROR_INVALID_NAME_CHAR | DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER |
DNS_ERROR_NUMERIC_NAME
Numeric text can be ambiguous
DnsValidateName returns DNS_ERROR_NUMERIC_NAME when the complete name, or its first label, consists only of digits, except for specific domain-oriented validation formats. Windows treats the result as an invalid host name. The rule prevents ambiguous input such as a supposed hostname that could be mistaken for an address or an application-specific number.
This does not mean every numeric DNS label is forbidden by the DNS protocol. The selected DNS_NAME_FORMAT and the caller’s intention are decisive. An application validating a hostname should not weaken the check merely because a domain-oriented format accepts a broader grammar.
What to inspect
- Decide whether the input is meant to be an IP address, a hostname, or a general DNS domain name.
- If it is an address, parse it with an IP-address API instead of passing it through hostname validation.
- If a numeric label is intentional DNS data, select the documented domain format and test interoperability with the authoritative server.
- Preserve leading zeros and original text in logs; automatic numeric conversion can hide the value the user supplied.
References
Looking for a different code? Search another status or error code.
