Domain names are specified as case-insensitive in the ASCII letter range (A-Z is equivalent to a-z). strcasecmp uses the current locale and can therefore produce incorrect results.