Temporary failure in name resolution


I have running Asterisk and FreePBX on a Raspberry Pi. It’s using raspbian which is based on Debian.
In my Asterisk logfiles I have multiple errors like this:
ERROR[1921] netsock2.c: getaddrinfo(“domain.com”, “(null)”, …): Temporary failure in name resolution
Followed by:
NOTICE[1921] chan_sip.c: Warning: Re-lookup of ‘domain.com’ failed!

I replaced the real domain name by “domain.com”. The real domain name in there is the DynDNS name which refers to my public ip address.
The weird thing is that I can ping the DNS name from raspbian directly without any problems. The output of “host domain.com” also correctly gives me the ip address. Why Asterisk/FreePBX can’t resolve this properly?

Any ideas?

I am having the system type of error message on my FreePBX system v. on Monday.
The issue just happened for a 2 hours time window and went away.
But I think the issue on my system is diff. from yours as the server my FreePBX registering to is of a 3rd party and it has been running find for more than 1 year until the 10th of September 2018.