# dynamic dns & receiving mails & delivery



## Alain De Vos (Apr 30, 2020)

I've got a public IP-address from the provider and a dynamic dns name which got updated every 15 minutes.
But if I'm correct in order to receive mails I need an MX-record.
How to do that & is that possible ?


----------



## rigoletto@ (May 1, 2020)

First of all if that is a fixed IP you don't need dynamic domain name because the IP is not supposedly to change.

MX-record is configured on the DNS server, but this is likely you will have problems with e-mails being rejected due to the fact (I'm assuming) the IP is tier 3 (home client).


----------



## D-FENS (May 1, 2020)

Just like when having a web server you need a DNS name (A record) and a host to hold your files, with mail you need an MX record and a Mail server to hold your mails.
So you defnitely need to add an MX record (wherever you configured your dynamic DNS name) and you need to point that to the address of your mail server.
There is an example here: https://www.noip.com/support/knowledgebase/add-mx-record/

A small remark - your mail provider must know about your domain name, otherwise the server would reject incoming mails for that domain name. So you need to register your dynamic domain name within the mail provider.
My own DNS provider provides also Email services so I have everything in one package - I use their DNS and Mail servers with my domain name.


----------



## obsigna (May 1, 2020)

Alain De Vos said:


> I've got a public IP-address from the provider and a dynamic dns name which got updated every 15 minutes.
> But if I'm correct in order to receive mails I need an MX-record.
> How to do that & is that possible ?


By what technical means is your dynamic DNS updated every 15 min. In case it is by the way of the most common DynDNS protocol you may pass the MX in the query string of the URL.

For example, my domains are hosted by Strato (Germany), and I can update it by the way of calling the following URL:
https://dyndns.strato.com/nic/update?hostname=example.com&myip=123.456.78.90&mx=mail.example.com

I wrote a BLog post, which explains all the very details, including an update script which is called as part of the /etc/dhclient-exit-hooks when the server at home receives a new IP from the provider.

German: https://obsigna.com/articles/1444081029.html
English translation: https://www.translatetheweb.com/?from=de&to=en&a=https://obsigna.com/articles/1444081029.html

I wrote another Blog post which explains how this would fit into the setup of a full fledged home mail server.
English: https://obsigna.com/articles/1539726598.html

For mail delivery, you absolutely want to employ a relay host with good reputation, otherwise, you may experience that a huge part of your mails won't arrive your peers. This is explained in said BLog post as well.


----------



## gpw928 (May 1, 2020)

As others have indicated you need to clarify if your IP address is permanent.
The host to which the MX record points needs to have good uptime (not to mention competent and vigilant management).

It would help with direction if you clarify whether you want to run a full blown mail server, or just have a mail address in your own domain.


----------



## tingo (May 1, 2020)

Alain De Vos said:


> But if I'm correct in order to receive mails I need an MX-record.


Strictly speaking (see relevant RFC's) an MX record is not needed - mail to a specific host should work as well. 
If it works (and works well) today, with all anti-spam measures (SPF, DMARC, etc) is another question.


----------



## zirias@ (May 1, 2020)

If you're just talking about _receiving_ mail, there's no problem. An A-record is all that's needed, and worrying about anti-spam measures of other systems is for _sending_ mail (which definitely won't work well from a dynamically assigned IP address).


----------

