mirror of
https://github.com/kemko/PowerDNS-Admin.git
synced 2026-01-01 15:45:45 +03:00
re-fix root domain record via dyndns by providing @.domain.tld as hostname
This commit is contained in:
@@ -992,6 +992,12 @@ class Record(object):
|
||||
jdata = self.get_record_data(domain)
|
||||
jrecords = jdata['records']
|
||||
|
||||
if self.name.startswith('@'):
|
||||
self.name = '.'.join(self.name.split('.')[1:])
|
||||
allowed = ['A', 'AAAA']
|
||||
else:
|
||||
allowed = app.config['RECORDS_ALLOW_EDIT']
|
||||
|
||||
for jr in jrecords:
|
||||
if jr['name'] == self.name and jr['type'] == self.type:
|
||||
self.name = jr['name']
|
||||
|
||||
@@ -762,19 +762,19 @@ def dyndns_update():
|
||||
domain = None
|
||||
domain_segments = hostname.split('.')
|
||||
for index in range(len(domain_segments)):
|
||||
domain_segments.pop(0)
|
||||
full_domain = '.'.join(domain_segments)
|
||||
potential_domain = Domain.query.filter(Domain.name == full_domain).first()
|
||||
if potential_domain in domains:
|
||||
domain = potential_domain
|
||||
break
|
||||
domain_segments.pop(0)
|
||||
|
||||
if not domain:
|
||||
history = History(msg="DynDNS update: attempted update of %s but it does not exist for this user" % hostname, created_by=current_user.username)
|
||||
history.add()
|
||||
return render_template('dyndns.html', response='nohost'), 200
|
||||
|
||||
r = Record(type='A')
|
||||
r = Record()
|
||||
r.name = hostname
|
||||
# check if the user requested record exists within this domain
|
||||
if r.exists(domain.name) and r.is_allowed:
|
||||
|
||||
Reference in New Issue
Block a user