I am currently running the latest image on the site
( raspbx-06-03-2016.zip ) and after getting most things set up, I am
having issues with DNS dropping out. I have configured dnsmasq in an
attempt to get it to work, but it is not working.
Can anyone help out? I can manually update resolv.conf and get it to
work temporarily, but that is not a solution! Something keeps
overwriting the file.
--
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was having trouble keeping Asterisk going for internal calling during an Internet outage because of Asterisk locking up due to DNS failures. It doesn't happen often, but if there is ever an outage, I implemented the following...
Instead of dnsmasq, I've installed "Unbound" locally on the PBX. Unbound is useful as a DNS cache because it allows you to add or modify records in the local DNS cache. Simply having dnsmasq running as a cache wasn't enough. When the time-to-live expired before the internet or external DNS was back up, Asterisk would lock SIP up and no internal calls could be made because poof the cache entries were gone. This entirely depended on what my SIP provider has set as their TTL, and last I looked it wasn't even long enough to cover a 20 minute downtime.
So I created a cron script that pings a certain reliable server every couple of minutes to detect an outage. If it does, it tells Unbound to modify the local DNS cache entries for my SIP provider to point to a non-existent 192.168 server. That way, Asterisk is only failing to connect, not having a DNS failure, and won't lock up its entire SIP stack. I also link the cron script to a few Expect scripts and use fwconsole to disable the outgoing trunks and reload the config-- that way anyone dialing out from the inside gets an "all circuits busy message," instead of just dead air while Asterisk tries to connect to our dummy server. All other internal calling/voicemail/etc works fine for as long as the Internet/DNS is out. When the cron script detects that things are back up, it reverses everything... Deletes the entries from the local cache, reenables the trunks, reloads the config, and everything is back to normal.
Last edit: Jeff Melaragno 2016-08-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am currently running the latest image on the site
( raspbx-06-03-2016.zip ) and after getting most things set up, I am
having issues with DNS dropping out. I have configured dnsmasq in an
attempt to get it to work, but it is not working.
Can anyone help out? I can manually update resolv.conf and get it to
work temporarily, but that is not a solution! Something keeps
overwriting the file.
--
Dnsmasq is already installed by default and configured to cache local dns queries. The contents of /etc/resolv.conf should be:
Which will forward everything to Dnsmasq. The upstream servers used by Dnsmasq can be found in /var/run/dnsmasq/resolv.conf
I was having trouble keeping Asterisk going for internal calling during an Internet outage because of Asterisk locking up due to DNS failures. It doesn't happen often, but if there is ever an outage, I implemented the following...
Instead of dnsmasq, I've installed "Unbound" locally on the PBX. Unbound is useful as a DNS cache because it allows you to add or modify records in the local DNS cache. Simply having dnsmasq running as a cache wasn't enough. When the time-to-live expired before the internet or external DNS was back up, Asterisk would lock SIP up and no internal calls could be made because poof the cache entries were gone. This entirely depended on what my SIP provider has set as their TTL, and last I looked it wasn't even long enough to cover a 20 minute downtime.
So I created a cron script that pings a certain reliable server every couple of minutes to detect an outage. If it does, it tells Unbound to modify the local DNS cache entries for my SIP provider to point to a non-existent 192.168 server. That way, Asterisk is only failing to connect, not having a DNS failure, and won't lock up its entire SIP stack. I also link the cron script to a few Expect scripts and use fwconsole to disable the outgoing trunks and reload the config-- that way anyone dialing out from the inside gets an "all circuits busy message," instead of just dead air while Asterisk tries to connect to our dummy server. All other internal calling/voicemail/etc works fine for as long as the Internet/DNS is out. When the cron script detects that things are back up, it reverses everything... Deletes the entries from the local cache, reenables the trunks, reloads the config, and everything is back to normal.
Last edit: Jeff Melaragno 2016-08-28