Good morning,
You could enhance the dictionary structure by providing 3 more elements:
- fqdn: Which is a mapping of subdomain.domain.suffix
- registered domain: which is a mapping of domain.suffix
- one mapping for subdomain.domain (which would resolve the ip case issue)