# Bulk insert 'autoconfig' and 'autodiscover' DNS records

**URL:** <https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985>\
**Category:** Virtualmin\
**Created:** [March 22, 2021, 4:17am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985 "2021-03-22T04:17:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [March 22, 2021, 4:17am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/1 "2021-03-22T04:17:42Z")

</div>

**Ubuntu 20.04**

We migrated 150 domains from 4 inconsistently setup Virtualmin servers. What I mean inconsistent:

- On some servers no SSL enabled per website, only some
- On other servers no disk space monitoring because quotas were never setup properly from the start
- Sometimes DMARC/DKIM enabled and sometimes not
- 3rd Party DNS setup so no DNS integration

What’s most concerning, and what’s overrunning the help desk with support calls, is the lack of `autoconfig` and `autodiscover` DNS records. Hours of time working with all the different mail clients and their inconsistent behaviors.

I need a way to insert `autoconfig` and `autodiscover` DNS records on around 150 domains on a server.

Please help me.

---

<div class="post-metadata">

**Author:** ![toreskev](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/toreskev/32/160_2.png) [@toreskev](https://forum.virtualmin.com/u/toreskev)\
**Post date:** [March 22, 2021, 7:12am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/2 "2021-03-22T07:12:21Z")

</div>

Hello!

This can be done with the virtualmin CLI command.

> virtualmin modify-dns --all-domains --add-record “autodiscover A 127.0.0.1”

Replace with the IP you want it pointed to.  
Rerun again with autoconfig.  
Run the same with AAAA if you also want/need IPv6.

Should do the trick, but you might want to try with one domain first to be sure.  
Run ‘virtualmin modify-dns --help’ to see the available options.

---

<div class="post-metadata">

**Author:** ![tpnsolutions](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/tpnsolutions/32/69_2.png) [@tpnsolutions](https://forum.virtualmin.com/u/tpnsolutions)\
**Post date:** [March 22, 2021, 7:16pm UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/3 "2021-03-22T19:16:53Z")

</div>

@vander.host,

If you’re like me and you have setup a global set of autoconfig / autodiscover rules…

What I did was simply setup something like, [autoconfig.master.com](http://autoconfig.master.com) and [autodiscover.master.com](http://autodiscover.master.com) then I setup an alias [autoconfig.customer.com](http://autoconfig.customer.com) and [autodiscover.customer.com](http://autodiscover.customer.com) each which pointed to the “master” domains.

This means whenever I update the master config it also updates the “customer” config as it’s an alias.

Best Regards,  
Peter Knowles | TPN Solutions

---

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [March 23, 2021, 6:00am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/4 "2021-03-23T06:00:51Z")

</div>

Hi Peter @tpnsolutions ,

Thank so much for that.

> you have setup a global set of autoconfig / autodiscover rules

I’m not sure what you mean by that. I thought that autoconfig and autodiscover were per domain DNS records which simply allows destination email clients like Thunderbird and Outlook to query and find automatic email configuration data. That everything happens behind the scenes and that all is required are those records.

Are you implying that in order to make autoconfig and autodiscover DNS record work additional configuration is needed?

---

<div class="post-metadata">

**Author:** ![calport](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/calport/32/44_2.png) [@calport](https://forum.virtualmin.com/u/calport)\
**Post date:** [March 23, 2021, 7:28am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/5 "2021-03-23T07:28:52Z")

</div>

> [@vander.host](#):
>
> Are you implying that in order to make autoconfig and autodiscover DNS record work additional configuration is needed?

I can confirm that additional configuration is not needed: Virtualmin takes care of this on its own, out of the box, and that is how most of us leave it.

@tpnsolutions outlined a little hack which has the advantage of simplifying updates. This hack is entirely optional.

---

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [March 28, 2021, 8:54am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/6 "2021-03-28T08:54:55Z")

</div>

> @tpnsolutions outlined a little hack which has the advantage of simplifying updates. This hack is entirely optional.

I don’t get this part. Does this mean that all clients will have “[mail.main-server-domain.com](http://mail.main-server-domain.com)” instead of “[mail.their-own-domain.com](http://mail.their-own-domain.com)”?

As of a few days ago when I use autoconfigure all the settings are picked up properly but Thunderbird is now defaulting to the wrong SMTP SSL and so can’t send mail without accepting a certificate warning.

I don’t understand what’s going on because when I do a Let’s Encrypt check the sites look correct.

---

<div class="post-metadata">

**Author:** ![tpnsolutions](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/tpnsolutions/32/69_2.png) [@tpnsolutions](https://forum.virtualmin.com/u/tpnsolutions)\
**Post date:** [March 28, 2021, 10:42am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/7 "2021-03-28T10:42:03Z")

</div>

@vander.host,

Yes, which addresses your SSL issue noted as well.

Best Regards,  
Peter Knowles | TPN Solutions

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [April 5, 2021, 10:42am UTC](https://forum.virtualmin.com/t/bulk-insert-autoconfig-and-autodiscover-dns-records/109985/8 "2021-04-05T10:42:20Z")

</div>

Closed on April 5, 2021, 10:42am UTC

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
