Skip to content

An unofficial python implementation for managing freenom.com dns records.

License

Notifications You must be signed in to change notification settings

punklee333/freenom-dns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freenom-dns Script v2.x

An unofficial python implementation for managing freenom.com dns records.

Freenom

Freenom is the world's first and only free domain provider.

Install

pip install freenom-dns

How to use

Instantiate an object

from freenom_dns import Freenom

your_username = 'your username'
your_password = 'your password'
your_domain = 'your domain'
freenom = Freenom(your_username, your_password)

Show All Domains

freenom.show_domains()

Show All Records

freenom.show_records(your_domain)

Add One Record

# 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 One Record (if the record exists then modify)

# 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')

Set One Record (Add or Modify)

freenom.set_record(your_domain, 'my')
freenom.set_record(your_domain, 'my', '0.0.0.0')

Set Record List (Beta)

"""
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)

Delete One Record

freenom.del_record(your_domain, 'www')

Clear All Record (Beta)

freenom.clear_record(your_domain)

License

MIT

About

An unofficial python implementation for managing freenom.com dns records.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages