Summary:ASTERISK-07976: Asterisk doesn't like CNAMEs or DNS servers that are down
Reporter:The Elite Geek (the_elite_geek)Labels:
Date Opened:2006-10-21 19:16:40Date Closed:2006-11-16 13:01:23.000-0600
Versions:Frequency of
Description:Asterisk doesn't like CNAME records, for example, have two providers (or more), listed and then execute a "sip show peers". When one provider uses a CNAME record (to a different server), Asterisk simply copies the stats of the previous provider, as per this:

WDP/61990150xxx                5060     OK (27 ms)
VoXaLot/465xxxxx            N      5060     OK (27 ms)

When a providers DNS isn't reachable, asterisk reports all providers as UNREACHABLE (Down), even when queried single.

Other behaviours caused are ATAs dropping out randomly, calls not working, and asterisk basically unusable.

What I suggest as a resolution, though not sure how easy it would be to implement is better error handling, checking that it is an IP, much like PHP's gethostbyname() function.

I have given this "block" status, as it does affect all abilities of asterisk when a remote DNS issue occurs.
Comments:By: Olle Johansson (oej) 2006-10-29 14:07:16.000-0600

It's a known problem that our DNS handling is very buggy and needs to be rewritten. You are recommended to use a local DNS server that is always running and will handle these kind of situations, until we develop a proper DNS implementation in Asterisk.

By: Joshua C. Colp (jcolp) 2006-11-16 13:01:22.000-0600

DNS in Asterisk currently is blocking based, this leads to all sorts of issues when the DNS is down. This is something we will hopefully be making an effort to solve in the next development cycle but at this point in time there's nothing we can do. I would suggest following oej's suggestion. Peace!