500 Internal Server Error Editing DNS

I have an 500 Internal Server Error every time I try to add a record or delete a record (tested with both A records and CNAME records). I searched and other people have had this issue in other threads:

But there are no resolutions to this problem.

I have restarted the server several times and re-installed mailinabox.

The error is occurring with the ldns-signzone command, but the domain it occurs on is not the one I’m trying to edit, it appears to be happening on the first domain in the zones directory (it starts with an a)

Any help is appreciated, I can not edit any DNS entries.

Those /tmp entries for DOMAINSTARTSWITH_A are still in /tmp so I re-created the ldns-signzone command and the error I got is:

Zone not read, error: Syntax error, could not parse the RR’s rdata at /etc/nsd/zones/DOMAINSTARTSWITH_A.com.txt line 14

Line 14 in that file is simply:

    IN      A       ACTUAL_IP_ADDRESS

Here is the full error from /var/log/syslog

Jan 13 14:00:21 box Exception on /dns/custom/DOMAIN_REMOVED/A [POST]#012Traceback (most recent call last):#012 File “/usr/lib/python3/dist-packages/flask/app.py”, line 1817, in wsgi_app#012 response = self.full_dispatch_request()#012 File “/usr/lib/python3/dist-packages/flask/app.py”, line 1477, in full_dispatch_request#012 rv = self.handle_user_exception(e)#012 File “/usr/lib/python3/dist-packages/flask/app.py”, line 1381, in handle_user_exception#012 reraise(exc_type, exc_value, tb)#012 File “/usr/lib/python3/dist-packages/flask/_compat.py”, line 33, in reraise#012 raise value#012 File “/usr/lib/python3/dist-packages/flask/app.py”, line 1475, in full_dispatch_request#012 rv = self.dispatch_request()#012 File “/usr/lib/python3/dist-packages/flask/app.py”, line 1461, in dispatch_request#012 return self.view_functionsrule.endpoint#012 File “/usr/local/bin/mailinabox-daemon”, line 55, in newview#012 return viewfunc(*args, **kwargs)#012 File “/usr/local/bin/mailinabox-daemon”, line 317, in dns_set_record#012 return do_dns_update(env) or “Something isn’t right.”#012 File “/root/mailinabox/management/dns_update.py”, line 80, in do_dns_update#012 sign_zone(domain, zonefile, env)#012 File “/root/mailinabox/management/dns_update.py”, line 583, in sign_zone#012 dnssec_keys[“ZSK”],#012 File “/root/mailinabox/management/utils.py”, line 193, in shell#012 ret = getattr(subprocess, method)(cmd_args, **kwargs)#012 File “/usr/lib/python3.4/subprocess.py”, line 561, in check_call#012 raise CalledProcessError(retcode, cmd)#012subprocess.CalledProcessError: Command ‘[’/usr/bin/ldns-signzone’, ‘-e’, ‘20170212’, ‘-n’, ‘/etc/nsd/zones/DOMAINSTARTSWITH_A.com.txt’, ‘/tmp/KDOMAINSTARTSWITH_A.com.+007+07245’, ‘/tmp/KDOMAINSTARTSWITH_A.com.+007+04100’]’ returned non-zero exit status 1

1 Like

Ok I discovered what my problem was in case anyone else runs into this issue.

The problem wasn’t on line 14 but the line after. Somehow I had an MX record without a priority, so it was

IN MX DOMAIN.

instead of something like:

IN MX 10 DOMAIN.

Once I deleted that line the ldns-signzone command worked.

However you can’t just delete it with vi, cause I did that and it got overwritten again, you have to delete the invalid record with the mailinabox web interface and then all DNS will update.

So the moral is be very careful when adding your MX records that they have a valid PRIORITY because mailinabox won’t sanity check them.