AnalogJ / lexicon

Manipulate DNS records on various DNS providers in a standardized way.
MIT License
1.48k stars 305 forks source link

two part domain names #1235

Closed simonmcnair closed 2 years ago

simonmcnair commented 2 years ago

please can https://github.com/AnalogJ/lexicon/issues/353 be reopened as pynamecheap is no longer used and there are issues with handling two part domains such as .co.uk

I suspect this won't just apply to namecheap ?

Thanks :-)

simonmcnair commented 2 years ago

I have got this working, I think by modifying /usr/local/lib/python3.9/site-packages/lexicon/providers/namecheap.py ( https://github.com/AnalogJ/lexicon/blob/master/lexicon/providers/namecheap.py)

I added:

import tldextract

and then replacing all the occurrences of:

    sld, tld = domain.split(".")

with:

    extracted = tldextract.extract(domain)
    sld = extracted.domain
    tld = extracted.suffix
adferrand commented 2 years ago

Closed by #1237