Cleaned up DNS record functions

This commit is contained in:
Benjamyn Love 2020-05-12 11:17:58 -04:00
parent ce1bdb93b9
commit eebfbac692

View File

@ -8,6 +8,10 @@ api = Api(app)
class WhoIS():
def __init__(self, domain):
self.domain = domain
self.getWhois()
def getWhois(self):
self.registrar = 'Synergy Wholesale'
self.registrant = {'name': 'Test Case', 'email': 'tcase@test.com',
'eligibilitytype': 'Company', 'eligibilityid': '123456789'}
self.nameservers = ['ns1.dommain.tld', 'ns2.domain.tld']
@ -15,25 +19,14 @@ class WhoIS():
class DNS():
def __init__(self, domain):
self.getARecords()
self.getAAAARecords()
self.getMXRecords()
self.getTXTRecords()
self.getNSRecords()
self.domain = domain
self.getRecords()
def getARecords(self):
def getRecords(self):
self.a = '1.2.3.4'
def getAAAARecords(self):
self.aaaa = '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
def getMXRecords(self):
self.mx = {'mail.domain.tld': 10}
def getTXTRecords(self):
self.txt = 'v=spf1 +a +mx +include:spf.hostingplatform.net.au'
def getNSRecords(self):
self.ns = ['ns1.domain.tld', 'ns2.domain.tld']