Does Asterisk uses secondary DNS server?

Hello to all,

I know theres a problem regarding DNS on asterisk 1.8, and I know that the best way to resolve this it’s to install a DNS server on the same machine.

But, just for curiosity, assuming I don’t have a DNS server running on my * server, if I put on my resolv.conf two or three DNS servers, like OpenDNS as my primary server, and a DNS server on my private network as secondary, * will change to the secondary if my internet connection fails? Or * just asks to the primary server?

There’s one time when all my SIP extensions and trunks became unavailable, but I was able to see by a nslookup and dig that the secondary DNS server was working.

Sorry about my english.

Best regards,

Joao Marcelo

Asterisk uses the standard BIND libraries so will support all the relevant options.

David, thanks for your help.

Sorry, but now I’m confused, because when all SIP phones become unavailable I see that * wasn’t able to resolve names, but the O.S. (CentOS) was. So I had imagined that the * was able to just use the primary DNS since it was unavailable at that time.

Unfortunatly I wasn’t at the lab when the problem happened, so I don’t have enought data to make a conclusion.

Best regards,

Joao Marcelo

If Asterisk loses internet connectivity or DNS, it stops responding to all SIP devices and trunks, and all extensions lose connectivity. This bug has apparently been around since Asterisk 1.4, persisted through 1.6, and remains in 1.8

This is the Matt Jordan response

Asterisk uses synchronous hostname resolution when it performs a DNS lookup for a peer’s hostname. As such, if chan_sip has to resolve a hostname and the DNS server is not available, it can block the SIP do_monitor thread until the request times out. How long the call blocks is dependent on the system Asterisk is running on, but can be more then several seconds. Obviously, if a large number of peers have to be resolved and Asterisk enters this state, it will be come unresponsive to SIP traffic on a local intranet.

At this time, there we are not planning to implement a DNS cache or asynchronous DNS lookups in Asterisk. The best solution is to instead install and configure a local DNS cache on the system that Asterisk runs on - there are many very good ones available in all major Linux distributions (and I would imagine the same to be true for other Operating Systems). In the case where internet connectivity is lost, this should prevent long hostname resolution times as Asterisk will still hit the local DNS cache, as opposed to timing out. In Asterisk versions 1.8 and greater, you may also find that using the dnsmgr feature (which periodically refreshes DNS information on a separate background thread) will alleviate chan_sip from becoming unresponsive. Without having a local DNS cache, however, you may be simply trading which thread is blocked for a long period of time - so this is not a solution in and of itself.

If you can, please implement a local DNS cache on the system experiencing this behavior and retest, and let us know if this prevents the complete loss of SIP functionality when the DNS provider is no longer available (you’re obviously going to lose some SIP functionality[/quote]

My Suggestion
A real and fast solution to this problem, change any domain name to his current IP address. on the SiP trunk configuration

It uses synchronous resolution because that’s what the standard BIND libraries do.

Thank you very much.

You guys helped me a lot.

Best Regards,

Joao Marcelo