Platform SDK: Network Management

DnsNameCompare

The DnsNameCompare function compares two DNS names. Like many DNS functions, the DnsNameCompare function type is implemented in multiple forms to facilitate different character encoding. Based on the character encoding involved, use one of the following functions:

DnsNameCompare_A (_A for ANSI encoding)

DnsNameCompare_W (_W for Unicode encoding)

If the DnsNameCompare function type is called without its suffix (_A or _W), a compiler error will occur.

BOOL DnsNameCompare(
  LPSTR pName1,
  LPSTR pName2
);

Parameters

pName1
[in] First DNS name of the comparison pair.
pName2
[in] Second DNS name of the comparison pair.

Remarks

Name comparisons are not case sensitive, and trailing dots are ignored.

As with other DNS comparison functions, the DnsNameCompare function deems different encoding as an immediate indication of differing values, and as such, the same names with different characters encoding will not be reported identically.

Return Values

Returns TRUE if the compared names are equivalent, FALSE if they are not.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Windns.h.
  Library: Use Dnsapi.lib.

See Also

DnsQuery, DnsRecordCompare, DnsRecordSetCompare