If you are not familiar with DNS requests and responses, just play around with your Python console and socket.gethostbyname_ex(hostname)
import socket socket.gethostbyname_ex('mail.google.com')
The answer should look like this:
('googlemail.l.google.com', ['mail.google.com'], ['184.108.40.206', '220.127.116.11'])
If the front-end is running with --authdomain=myauthdomain.com a lookup string may look like this:
When a back-end is connecting, the front-end queries the DNS server and extracts authentication errors and extended quota info from CNAME replies.
(hn, al, ips) = socket.gethostbyname_ex(lookup)
The primary hostname is splitted into error, days and connections informations:
if al: error, hg, hd, hc, junk = hn.split('.', 4) q_days = int(hd, 16) q_conns = int(hc, 16) else: error = q_days = q_conns = None
A few constants are defined in common.py
AUTH_ERRORS = '255.255.255.' AUTH_ERR_USER_UNKNOWN = '.0' AUTH_ERR_INVALID = '.1'
If ips starts with '255.255.255.' then an authentication error just happened: the user may be unknown (ips ends with '.0') or invalid (ips ends with '.1').
Otherwise the user has been authenticated and the quota is encoded in the IP. Look at LookupDomainQuota to see how it works.