[asterisk-users] No retry after DNS failure

Rich Adamson radamson at routers.com
Tue Aug 22 02:49:10 MST 2006


John Marvin wrote:
> Today I had a brief power outage which caused the Asterisk server and 
> DSL modem to reboot. The Asterisk server came up before the internet 
> connection was working, so it failed when try to look up some of the 
> hosts for my outbound voip providers in sip.conf.
> 
> Asterisk never recovered from that, i.e. it never retried so those 
> providers were unavailable. The only provider that was still available 
> was one that I had entered the IP address for, rather than the host name.
> 
> Have any of you run into this issue, and if so, how have you solved it? 
> It seems that since Asterisk periodically tries to reregister it should 
> also retry the DNS lookup at the same time, rather than never trying 
> again if the lookup fails. This would indicate that Asterisk would also 
> fail if the voip provider changed the IP address of its server because 
> Asterisk would never see the new IP address.
> 
> Here are some workarounds I thought of, but none of them are 
> particularly good:
> 
> 1) Get a UPS so my machines won't reboot when the power fails. This 
> actually might not solve anything, because I'm connected to a remote 
> DSLAM in my neighborhood that I believe does not have backup power, so 
> it won't work when the power is out. But perhaps Asterisk is more robust 
> after it has booted (I'll have to test this).
> 
> 2) Change all host names in sip.conf to IP addresses. This is kind of 
> ugly and also will break when a voip provider changes their IP address. 
> There is a reason for DNS!
> 
> 3) Have a cron job send asterisk periodic "sip reload" commands.
> 
> 4) Delay the start of asterisk until the internet connection has come 
> up. This could cause me to be without any phones if there is any delay 
> or failure in bringing up the network (I also have zap channels and PSTN 
> lines).
> 
> 5) A hybrid of ideas 3 and 4 above: Have a startup script that waits for 
> the internet connection to come up, and then sends a "sip reload" 
> command to Asterisk.
> 
> Any other ideas?

If memory serves correctly, most of the above has been raised as issues 
in the past and the suggested work around has been to run a dns caching 
server on the asterisk box.

FWIW, I always use IP addresses instead of dns names. But, I don't have 
to deal with dynamic ip changes of any device either.





More information about the asterisk-users mailing list