[Home]

Summary:ASTERISK-14153: DNS host name resolution in iax.conf
Reporter:vieri (vieri)Labels:
Date Opened:2009-05-17 14:00:54Date Closed:2011-06-07 14:07:21
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I defined host=voipb1.mydomain.local in a iax.conf trunk and it was working fine until the DNS A record of that host changed IP address. Asterisk still tried to send calls to the old IP address.
I restarted Asterisk and the calls were finally sent to the correct IP address so I'm guessing that the "host=" name resolution is done only at startup.  

iax.conf:

[coin]
deny=all
allow=alaw
allow=gsm
type=friend
host=voipb1.mydomain.local
secret=xxx
auth=plaintext
qualify=yes
context=coin-context


****** ADDITIONAL INFORMATION ******

Expected behavior:

The IP address in "host=" should not be resolved only once at Asterisk startup but whenever required, according to DNS TTL.
Comments:By: Matt Riddell (zx81) 2009-05-17 16:20:14

Are you using the dns manager?

By: vieri (vieri) 2009-05-18 04:33:17

I'm using:

# cat dnsmgr.conf
[general]
enable=yes
refreshinterval=60

*CLI> dnsmgr status
DNS Manager: enabled
Refresh Interval: 60 seconds
Number of entries: 2

Does the DNS manager work with the /etc/hosts file?
I tried changing the IP address within /etc/hosts and waited more than 60 seconds (failed).

I'm using djbdns in my network so I tested it with a record A with TTL=5min. I changed the IP address in tinydns and waited 6 minutes. A ping to the host name resolved the new address fine. However, Asterisk will still send the call to the old IP address, unless I restart the * process.

How can I "debug" dnsmgr in Asterisk? Could I actually "see" the 2 entries that "dnsmgr status" reports, thus confirming that it is not updating correctly?

By: Joshua C. Colp (jcolp) 2009-05-18 09:23:34

I've just tested this using /etc/hosts and it worked as expected. Do you see:

== Refreshing DNS lookups.

At the specified refresh interval?

By: vieri (vieri) 2009-05-18 13:30:45

When I reported this bug I didn't see the "Refreshing DNS lookups" messages, even after a "dnsmgr reload" or killing the asterisk process.

I stopped Asterisk once again, checked that it was really dead, restarted it and now I see the "Refreshing DNS lookups" messages. Everything is working as expected now.

I really don't know what went wrong in my previous tests. Anyway, thanks for your time and sorry for the noise.

By: Joshua C. Colp (jcolp) 2009-05-18 13:33:13

Closed per reporter, after a restart the dns manager is now working as expected.