DNScode 1.4.1
Simplifying DNS configuration
|
Public Member Functions | |
__post_init__ (self) | |
__str__ (self) | |
new_A (self, str name='@', int ttl=3600, str host='0.0.0.0') | |
new_AAAA (self, str name='@', int ttl=3600, str host='fe80::42:2cff:fe29:8db1') | |
new_CNAME (self, str name='@', int ttl=3600, str host='example.com') | |
new_MX (self, str name='@', int ttl=3600, int priority=10, str host='example.com') | |
new_NS (self, str name='@', int ttl=3600, str host='example.com') | |
new_PTR (self, str name='@', int ttl=3600, str host='example.com') | |
new_SOA (self, str mname='ns1.example.com', str rname='admin.example.com', int serial=int(time.time()), int refresh=86400, int retry=7200, int expire=15552000, int ttl=21700) | |
new_SRV (self, str name='@', int ttl=3600, str service='service', str protocol='proto', int priority=10, int weight=10, str host='example.com') | |
new_record (self, str name='@', int ttl=3600, str rtype='A', str data='0.0.0.0') | |
add (self, Record record) | |
save_file (self, str filepath) | |
Public Attributes | |
str | records = str(record) + '\n' |
Static Public Attributes | |
str | origin = 'example.com' |
list | records = field(default_factory=list) |
Represents a DNS zone containing multiple records.
dnscode.dnscode.Zone.__post_init__ | ( | self | ) |
Initializes a zone with the given origin and ensures it ends with a dot.
dnscode.dnscode.Zone.__str__ | ( | self | ) |
Returns a string representation of the zone.
dnscode.dnscode.Zone.add | ( | self, | |
Record | record ) |
Adds a record to the zone.
dnscode.dnscode.Zone.new_A | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | host = '0.0.0.0' ) |
Creates and adds a new A record to the zone.
dnscode.dnscode.Zone.new_AAAA | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | host = 'fe80::42:2cff:fe29:8db1' ) |
Creates and adds a new AAAA record to the zone.
dnscode.dnscode.Zone.new_CNAME | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | host = 'example.com' ) |
Creates and adds a new CNAME record to the zone.
dnscode.dnscode.Zone.new_MX | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
int | priority = 10, | ||
str | host = 'example.com' ) |
Creates and adds a new MX record to the zone.
dnscode.dnscode.Zone.new_NS | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | host = 'example.com' ) |
Creates and adds a new NS record to the zone.
dnscode.dnscode.Zone.new_PTR | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | host = 'example.com' ) |
Creates and adds a new PTR record to the zone.
dnscode.dnscode.Zone.new_record | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | rtype = 'A', | ||
str | data = '0.0.0.0' ) |
Creates and adds a generic DNS record to the zone.
dnscode.dnscode.Zone.new_SOA | ( | self, | |
str | mname = 'ns1.example.com', | ||
str | rname = 'admin.example.com', | ||
int | serial = int(time.time()), | ||
int | refresh = 86400, | ||
int | retry = 7200, | ||
int | expire = 15552000, | ||
int | ttl = 21700 ) |
Creates and adds a new SOA record to the zone.
dnscode.dnscode.Zone.new_SRV | ( | self, | |
str | name = '@', | ||
int | ttl = 3600, | ||
str | service = 'service', | ||
str | protocol = 'proto', | ||
int | priority = 10, | ||
int | weight = 10, | ||
str | host = 'example.com' ) |
Creates and adds a new SRV record to the zone.
dnscode.dnscode.Zone.save_file | ( | self, | |
str | filepath ) |
Saves the zone records to a file.
|
static |
|
static |
str dnscode.dnscode.Zone.records = str(record) + '\n' |