Solved

Asterisk slow to load and run if DNS server is not available

Posted on 2011-09-04
11
1,160 Views
Last Modified: 2012-05-12
I am running a couple of asterisk servers.  They are set to use a local DNS server - which forwards unknown domains to an external DNS.  I am seeing the following issues with Asterisk and DNS and any help is appreciated.

1. If the external resolution DNS is not available, when I try to load the dialplan, it takes a very long time.  you can see it loading 1 line at a time every few seconds.

2. If the local DNS server is down for any reason even after the asterisk load, it starts acting slow and erratic.

Is this an Asterisk issue or a CentOS issue.  And what can I do to avoid these slowdowns if the DNS's are down.
0
Comment
Question by:thetechgroup
  • 5
  • 3
  • 3
11 Comments
 
LVL 36

Expert Comment

by:grblades
ID: 36483095
I would suggest you run a caching only nameserver on the asterisk box. You can set a forwarder to your regular DNS server aswell if you wish.
0
 

Author Comment

by:thetechgroup
ID: 36483562
Would you then point the resolv to the local DNS instead of the general DNS?  Seems like that could work.  Do you have any idea what it is looking for that causes it to slow down considerably?
0
 
LVL 36

Expert Comment

by:grblades
ID: 36483573
Yes you would point resolv.conf to the loopback address 127.0.0.1.
I am not sure whats causing it to slow down. You could run tcpdump on port 53 so it shows you all the dns requests.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:thetechgroup
ID: 36488067
Sounds like a good idea.  Let me try and report back.
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 36497447
You could try changing trunk host registrations, to IP address rather than Hostname...then it won't need to resolve them.

See this article and tell me if you think it might apply to your situation.
http://www.voip-info.org/wiki/view/Asterisk+SIP+srvlookup
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 36497481
...also, how about these options in sip.conf...

http://www.asteriskdocs.org/html/apas02.html

externhost
externhost takes a fully qualified domain name as its argument. If Asterisk is behind NAT, the SIP header will normally use the private IP address assigned to the server. If you set this option, Asterisk will perform periodic DNS lookups on the hostname and replace the private IP address with the IP address returned from the DNS lookup.

    externhost=my.hostname.tld

 Warning
The use of externhost is not recommended in production systems, because if the IP address of the server changes, the wrong IP address will be set in the SIP headers until the next lookup is performed. The use of externip is recommended instead.
 

externip
externip takes an IP address as its argument. If Asterisk is behind NAT, the SIP header will normally use the private IP address assigned to the server. The remote server will not know how to route back to this address; thus, it must be replaced with a valid, routable address.

    externip=216.239.39.104
0
 

Author Comment

by:thetechgroup
ID: 36498164
Actually, all our trunk registrations are IP based and we do not use externip or externhost.  The production PBX's do not reside behind a NAT.  Is it possibly not an Asterisk issue, but a LINUX requirement to have a valid and live DNS active at all times?
0
 
LVL 25

Expert Comment

by:Ron Malmstead
ID: 36498814
Have you checked /var/log/asterisk/messages   for any errors?

Or /var/log/messages for system errors?
0
 

Author Comment

by:thetechgroup
ID: 36584681
I still have not had a chance to install bind on the asterisk boxes yet.  Other issues came ahead, but this is still a modification we would like to make. What is the best way to configure bind as a caching server?
0
 
LVL 36

Accepted Solution

by:
grblades earned 250 total points
ID: 36585469
Depends on the distribution. If you are running Centos/Redhat then there is a package called caching-nameserver or something similarly named which you just install and set to start automatically.
0
 

Author Closing Comment

by:thetechgroup
ID: 36587874
Thanks.  That makes perfect sense.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Computers Wont Join Domain 5 56
DNS Woes 7 50
QoS for Voip 7 39
Need Script to resolve IPs to Public DNS Names 5 26
I've written instructions for one router type, but this principle may be useful for others of the same brand and even other brands of router. Problem: I had an issue especially with mobile devices that refused to use DNS information supplied via…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question