Hi all,
I just thought I'd post my recent struggle with Sofia and DNS resolution.
First things first I run Freeswitch 1.10.2. I currently give all of my tenants a gateway that goes to an ASTPP box which allows me to keep track of of them individually for billing purposes. Originally all the gateways pointed to the local IP of that ASTPP box and this worked well, however I'm starting to replicate to an off site fail over site and the ASTPP box at the other site has a different local IP, so my solution was going to be to change all the gateways from IP to a host name and then just add an entry to the hosts file on each box to reflect the different ips of the respective ASTPP boxes. Simple right?
So I tested with a dummy domain to begin with (thankfully) . I made my hosts entries and changed the gateway proxy from an IP address to a host name, stopped and started the gateway but no reg. I checked credentials, etc, still nothing. I changed it back to the IP and it reged. I then looked in the logs and found that when I tried to start the gateway with a host name it failed with a "DNS Error [503]" . I could ping the host name no problem, so then I did a little research.
Some people reported that Sofia would usually bypass the hosts file for name resolution and that you needed a proper resolver. Well that's a pain in the butt. So I installed dnsmasq as a local resolver and put the necessary entry in. I did a dig on the host name and everything looked good . Swell right? Nope still no reg. So back to research..
Apparently Sofia will do an initial lookup at some point and cache it but it will not do a lookup for a reg event. Actually some people say they don't see any DNS traffic coming from their freeswitch boxes at all after initial startup (I find that hard to believe though). What I have found is that Sofia has a DNS cache and that cache is seldom purged or updated. What I ended up doing was putting a different host name entry into dnsmasq, and the I created another gateway from scratch with the new host name. That worked!! Adding the new gateway must have forced a lookup!
Anyway, after hours I'm going to see if restating Freeswitch will force a lookup on existing gateways. It's an obscure problem for a specific use case but I thought I'd document it here in case someone runs into the same thing.
I'll update if I find out more.
I just thought I'd post my recent struggle with Sofia and DNS resolution.
First things first I run Freeswitch 1.10.2. I currently give all of my tenants a gateway that goes to an ASTPP box which allows me to keep track of of them individually for billing purposes. Originally all the gateways pointed to the local IP of that ASTPP box and this worked well, however I'm starting to replicate to an off site fail over site and the ASTPP box at the other site has a different local IP, so my solution was going to be to change all the gateways from IP to a host name and then just add an entry to the hosts file on each box to reflect the different ips of the respective ASTPP boxes. Simple right?
So I tested with a dummy domain to begin with (thankfully) . I made my hosts entries and changed the gateway proxy from an IP address to a host name, stopped and started the gateway but no reg. I checked credentials, etc, still nothing. I changed it back to the IP and it reged. I then looked in the logs and found that when I tried to start the gateway with a host name it failed with a "DNS Error [503]" . I could ping the host name no problem, so then I did a little research.
Some people reported that Sofia would usually bypass the hosts file for name resolution and that you needed a proper resolver. Well that's a pain in the butt. So I installed dnsmasq as a local resolver and put the necessary entry in. I did a dig on the host name and everything looked good . Swell right? Nope still no reg. So back to research..
Apparently Sofia will do an initial lookup at some point and cache it but it will not do a lookup for a reg event. Actually some people say they don't see any DNS traffic coming from their freeswitch boxes at all after initial startup (I find that hard to believe though). What I have found is that Sofia has a DNS cache and that cache is seldom purged or updated. What I ended up doing was putting a different host name entry into dnsmasq, and the I created another gateway from scratch with the new host name. That worked!! Adding the new gateway must have forced a lookup!
Anyway, after hours I'm going to see if restating Freeswitch will force a lookup on existing gateways. It's an obscure problem for a specific use case but I thought I'd document it here in case someone runs into the same thing.
I'll update if I find out more.