Extensions fail when internet down

Has anyone ever found a real, working solution to the problem that causes Asterisk to freeze up and extensions not to work whenever the internet goes down?

I’ve been able to do it by using only numerical IP addresses in trunk settings and by configuring the Asterisk SIP Settings with the correct internal and external IP addresses, but I’m wondering if there’s a fix that allows you to use domain names again?

Try http://goo.gl/xjlPC

I’ve seen that.

I don’t see that as a real solution, as a caching nameserver eventually times out…

My solution, which works well is:

  1. Configure Asterisk SIP Settings at least once. Just go to the page, click SAVE, and then Orange Bar.

  2. Configure all SIP Trunks with IP addresses and not domain names.

  3. Ensure that SRV Lookup is OFF.

The caching server from the thread I posted does not expire records from its cache.
Not using dns is obviously a viable solution as well :wink:

Okay, how about this:

I think I have a more elegant answer, but I need someone’s assistance.
The problem is that Asterisk receives no response to its DNS queries.

My solution is to set my resolv.conf file to have two real nameservers and the final nameserer will point to a fictional, local nameserver. I say fictional, because it’ll resolve all DNS requests with a fictional DNS. Why a fictional DNS? Why not? If the internet is down, we just want Asterisk to get SOMETHING so it won’t freeze. Since the internet is DOWN, we don’t really care is that something is valid or not. Of course, if the internet is up, the first two real nameservers will be used, and a real response will be given.

Here’s the question: How do I set up a fictional nameserver, i.e. one that just responds to all queries with 11.11.11.11?

Put another way, I know that the hosts file is consulted FIRST, before the DNS servers in resolv.conf. Is there a second hosts-like file that is consulted AFTER resolv.conf?

Is there a line that I can put in resolv.conf that will just force 11.11.11.11 if all else fails?

I think I’m halfway there. You can make hosts the backup source instead of the primary source:

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-network-config-hosts.html

“To change lookup order, edit the /etc/host.conf file. The line order hosts, bind specifies that /etc/hosts takes precedence over the name servers. Changing the line to order bind, hosts configures the system to resolve hostnames and IP addresses using the name servers first. If the IP address cannot be resolved through the name servers, the system then looks for the IP address in the /etc/hosts file.”

Now, is there a wildcard entry that I can use in the hosts file?

i.e.

11.11.11.11 *

To solve the problem you need to install Bind DNS nameserver and set up 127.0.0.1 as a primary dns server and 8.8.8.8 as a secondary.

How long will that solve the problem for, i.e. if the internet is down for 4 hours, will the bind nameserver continue serving whatever it got previously?

Amazingly, it seems that nobody ever actually opened a bug report on this issue. I’ve now done so…

https://issues.asterisk.org/jira/browse/ASTERISK-18930?focusedCommentId=185287#comment-185287