A Whois query for a domain is performed by sending the request to the respective registry company through authorized IP addresses or to the database maintained by official registrars hosting the Whois server. These registrars have established dedicated servers with specific security measures and agreements to handle Whois queries.