Files
rengine/shared/utils/infra.py
T
Yogesh Ojha 69239333bc Refactor validation and DNS tools, implementation of onboarding wizard
- Added `clean_name` function to `validation.py` for name validation with max length.
- Simplified docstrings in `dnsx` client, parser, and service files for clarity.
- Enhanced error handling in `ViewDNSService` to prevent disabling keys on rate limits.
- Improved WHOIS service to handle concurrent inserts gracefully with integrity checks.
- Updated `Settings` class in worker config to inherit from `BaseAppSettings`.
- Added new dependencies in `pyproject.toml` for `apprise` and `cryptography`.
2026-06-21 21:56:20 +05:30

49 lines
1.0 KiB
Python

_SHARED_NS_TOKENS = frozenset(
{
"cloudflare",
"awsdns",
"azure-dns",
"googledomains",
"ultradns",
"dnsmadeeasy",
"akamai",
"domaincontrol",
"registrar-servers",
"worldnic",
"name-services",
"cloudns",
"vercel-dns",
"wpengine",
"wixdns",
"squarespacedns",
"dnsimple",
"nsone",
}
)
_SHARED_NS_DOMAINS = frozenset(
{
"he.net",
"gandi.net",
"ovh.net",
"akam.net",
"name.com",
"digitalocean.com",
"linode.com",
}
)
def is_shared_nameserver(host: str | None) -> bool:
if not host:
return False
normalized = host.strip().lower().rstrip(".")
if not normalized:
return False
if any(token in normalized for token in _SHARED_NS_TOKENS):
return True
return any(
normalized == domain or normalized.endswith(f".{domain}")
for domain in _SHARED_NS_DOMAINS
)