Skip to content

Wildcard Custom Domains

Alexander Epolite edited this page Mar 27, 2024 · 5 revisions

Wildcard Custom Domains

Starting March 26th 2024, you can setup wildcards on your custom domains. This is a guide on how to set them up.

API methods referenced are only available on v2.

OPTION 1: Get the value on your accounts page

Visit https://accounts.tempmail.lol/ and click Get Wildcard Value to get the value you need.

OPTION 2: API

First, send a POST request to https://api.tempmail.lol/v2/wildcard, with the Authorization header containing your API Key before Bearer, something like this:

const r = await fetch("https://api.tempmail.lol/v2/wildcard", {
    method: "POST",
    body: "", //empty for this endpoint
    headers: {
        "Authorization": "Bearer tm.1234567890.abcdefghijklmnopqrstuvwxyz",
    },
});

console.log(await r.text());

The result should contain the record_value. Save this value, it will be something like tempmail-wc-<random chars>. If you lose it, you will need to call the endpoint again.

Now, go to your DNS provider.

Example DNS setup for *.mail.example.com.

Name Value Type Description
*.mail.example.com The tempmail-wc- variable TXT The TXT value. Will start with tempmail-wc- followed by random characters.
*.mail.example.com tmmx.example.com MX The MX record. Make sure this covers the same wildcard as the TXT record.
tmmx.example.com [see below] A OR AAAA The IP address of our email server, obtained from the website.

For the A or AAAA record (if yours is IPv4 or IPv6), login to your account on https://accounts.tempmail.lol to obtain the IP address.