Set www A (and other DNS) records after install


I’ve installed mail-in-a-box and it’s working pretty much perfectly. However I’d like to point my DNS www record at a different server using the mail-in-a-box name servers. I’ve tried editing the NSD zones files to reflect a change to the www record and then I stopped and re-started the NSD service but the www record still points at the mail server. Also after a reboot the records return to their previous state.

Is there a step I’m missing, or another way to accomplish this?


In the admin (/admin) there are instructions. You can’t hack the box directly.

Thank you Josh,

It looks like I have to use an External DNS to get this functionality - unless I’m missing something?

Thanks again,


You can use the box’s DNS API to set different DNS records.

Thanks Josh,

I must be stupid or just missing something - but where is the documentation on how to access the API? I cant seem to find it in the /admin panel.



Do you have the most updated version of mail-in-a-box.

Theres a tab in the System…pull down menu and click DNS (Custom/External)

This will bring you to custom DNS.

There a couple of examples to show how to use curl function to send your request.

Basically you use HTTP request to submit your command to the python function to edit your DNS.

curl -d “” --user {email}:{password}{qname}[/{rtype}[/{value}]]

Its pretty self explanatory and execute this in curl supported shell. The “” box is for you value, took me a second to figure out even though there are examples to show that. I did a recent command to update my A record for www. This is what I used

curl -d "value=“IP_ADDRESS” --user********

I exclude my personal details. I hope this helps.


Hello Guys,

I tried to find the DNS API documenation how to set it. In my box I have only this menus
Status Checks
External DNS (Advanced)


I cannot find DNS (Custom/External) under system. Did I miss something?


The examples are in the master branch, not 14.08-beta which you probably have installed.

Have a look on github for the examples.


# sets to point to the IP address of the machine you are executing curl on
curl -d "" --user

# sets an alias
curl -d "" --user

# sets a TXT record
curl -d "value=something%20here" --user https://{{hostname}}/admin/dns/set/

# clears the TXT record
curl -d "value=" --user

@jmar71n thanks! I just updated to master branch now I see the menu. Thanks!

Thanks everyone - reverting to the master branch worked for me as well :slight_smile:

Once you add a DNS record, is it supposed to show up in the “DNS (Advanced)” page? Because it’s not showing for me after I add a record:

I switched to the master branch.

I connected to my mailinabox with ssh

Did I do this correctly? Or am I also supposed to add the domain to the DNS tab in DigitalOcean for the second server and manage the DNS that way?


Nevermind, I had to first add an email user for the second server. It shows up now.