An unofficial python implementation for managing freenom.com dns records.
Freenom is the world's first and only free domain provider.
pip install freenom-dns
from freenom_dns import Freenom
your_username = 'your username'
your_password = 'your password'
your_domain = 'your domain'
freenom = Freenom(your_username, your_password)
freenom.show_domains()
freenom.show_records(your_domain)
# add '' record name with public ip
freenom.add_record(your_domain)
# add 'www' record name with public ip
freenom.add_record(your_domain, 'www')
freenom.add_record(your_domain, 'www', '192.168.1.1')
freenom.add_record(your_domain, '_dnsauth', type='txt', ttl='3000', target='33333333')
# modify '' record name with public ip
freenom.modify_record(your_domain)
# modify 'www' record name with public ip
freenom.modify_record(your_domain, 'www')
freenom.modify_record(your_domain, 'www', '192.168.2.2')
freenom.modify_record(your_domain, '_dnsauth', ttl='2800', target='88888888')
freenom.set_record(your_domain, 'my')
freenom.set_record(your_domain, 'my', '0.0.0.0')
"""
record_list:
{name}: *required!!!
{type}: default: A
{ttl}: default: 3600
{target}: default: your Public IP
"""
record_list = [
{'name': ''},
{'name': 'www', 'target': '100.100.100.100'},
{'name': '_dnsauth', 'type': 'txt', 'ttl': '2800', 'target': '22222222'}]
freenom.set_record_list(your_domain, record_list)
freenom.del_record(your_domain, 'www')
freenom.clear_record(your_domain)