Why do I need to be on the internet for my phones to register over a local network?

Hi guys,

Sorry for the probable newbie question, but I am studying and learning.

Yesterday after heavy rain, my internet went out and my phones could not register. My setup is all over a local network. I have a couple IP Phones, a Cisco/Linksys ATA and a machine running FreePBX. They are all on the same network, same subnet, etc. Why does the internet connection matter for phone registration? I understand it affecting trunks (obviously SIP trunks wont work) but why wont the phones register?

Thank you for your help.

You don’t need Internet to get sip phones register in your LAN.

Maybe the Asterisk log can help you…

# tail -f /var/log/asterisk/full 

Can You post Your sip_*.conf?

I suspect that you’re using domain names for your server, or something like this. Find your device configs and set the IP address of your server, do not use the name of the server. Unless you are running your own DNS server, then you would need to make changes there.

I presume you are using this at home, probably using a dynamic IP address and using something like Dyn DNS for a domain name?

It would help if you could post your Network Topology, give as mush information about it as you can.

Thank you guys for your reply. The logs baffle me. Too much info and I am not yet used to all the terms. I will study them to understand better.

I did install BIND on the server, but maybe I didnt configure it correctly. In any case, the phones are all configured with the server’s IP address, not a url.

My network is set up like this:

IPPBX Server 192.168.0.250
|
Managed 3Com Switch 192.168.0.253
|
Router 192.168.0.1
|
Modem 192.168.25.1

The Router is in the modem’s DMZ and the server is in the router’s DMZ.

The IP phones, computers, TVs, and AP are connected to the switch as well.

So in theory, nothing should demand an internet connection to work unless you actually need the internet.

I have installed
PBX Firmware: 6.12.65-23
PBX Service Pack: 1.0.0.0
FreePBX 12.0.36

In my SIP settings, I have
NAT = YES
IP CONFIGURATION = Dynamic IP
Dynamic Host = xxx.no-ip.com

Is there any other information I can supply? Once again, I apologize for being new to all this.

The easiest solution might be to use dnsmasq instead of bind, you don’t need the complexity of bind, dnsmasq sets up as a caching name server simply by putting your preferred dns servers in the dnsmasq.conf file and having your resolv.conf file prefer 127.0.0.1

It is 95% an DNS issue. Your primary DNS should be localhost, like dicko mention - dnsmasq is the default on CentOS. You should also have /etc/hosts entry which correctly points to 127.0.0.1 or LAN IP address of the machine by the machine name (both short and with domain). Otherwise your system will boot really slow when no DNS available (it will hang couple of minutes on sendmail startup and other daemons).

Even when your sip registrations and host definitions do not use domain names, asterisk will lagg heavily on chan_sip when DNS becomes unavailable. That was at least on asterisk 1.8. I suppose the issue is still there.

Thank you for all your advice. I spent two days testing everything and I found out that the DNS server was in fact wrongy programmed, routing all requests to the external DNS servers. Therefore, any request in the local network would go to the internet for name resolution and then back to the server. I have switched to IP addresses for registration and it all works offline now, as it should.

Thanks

As I thought, now you can use the DNS server, but you have to set up zones for local items. I click on the forward lookup zones, right click and create a new zone. This zone is normally my internal network name for my local domain server, something like pluto.planet.space or whatever your server and domain is.

Once created, right click and add new host (A or AAAA), give give the item (phone) a name like cisco 7960 or an extension number, totaly up to you. You will see the FQDN populate below it (if this is on a windows server), give it an IP address and for this you should use DHCP to issue a (static/reserved) address, you do not want the address to change on the phone.

I point all machines and phones to my DNS server, I have my DNS server to use public DNS servers like Google and a few others for failover. I can ping any device by name and have the IP address resolve correctly.

Little bit of setting up and it works great… Linux is a different beast, I am not well versed on linux.

Hi deanot26508. I think I will redo my local network so that I can use a local windows domain/dns server. I am also not well versed in Linux and this one was set up by a friend who is, so I really dont know how to manage it easily, although I could always learn. But why do that if windows is easier? LOL I will set a box up for that and follow your configuration advice. I will deactivate the BIND server in Linux so there is no DNS conflict. It is not configured correctly anyway.

One thing I didn’t understand. I already have a DHCP router assiging static/reserved IP addresses for the phones, but why do I need the DNS A record with a name for each phone? Does this help when they connect to the DNS server?

Not really, I use it to keep track of what phone is on what IP, unless you want to make notes of them all. If you only have one or two phones, it is no big deal, but if you are running say 50 - 100 of them, the chances of you reusing a used IP is likely.

I use both DHCP and DNS, DHCP to assign the ip which will always be the same one as it used the MAC address of the hardware, when the hardware asks the DHCP server for an IP, the MAC address is looked at and assigned to the phone if it is reserved against that MAC.

DNS is just another way I can name the device, you can give it many names to suit your need, like a name of the user, a location or whatever. Names are not really needed, but I like to name all my devices, that way I can see what is online and what is not, amongst a numerous amount of other things.

DHCP and DNS is fun to master, it has its uses in a large environment, you can use the DNS server to cache results which decreases the time required to go out onto the net to find the information (IP) of the website you are looking for. Results can be cached for as long as you want, but due to ever changing domain to ip names, it is best left at defaults.

Grab a book on DNS servers, there are a few around for Microsoft DNS servers which can help you.

Save yourself a whole bunch of effort and money, just use dnsmasq, it is already probably installed, you need to verify two line of configuration, in /etc/dnsmasq.conf to set your internet dns server (use server=8.8.8.8 unless you don’t trust Google), and /etc/resolv.conf to use 127.0.0.1 as your sole name server, that means connection on 53 will go to dnsmasq on your local machine, and it will respond with it’s cached host, even if you can’t get to it, then asterisk will be content and everything moves on seamlessly , it can’t be easier than that, no? No muss no fuss and it WILL work for you, it is also free, unlike M$soft anything, FreePBX/Asterisk is rooted in Linux, why buy into anything else? even M$ uses it for anything really important :wink:

Thanks for that tip. I am not very Linux-savy but I am learning. I will uninstall BIND and use DNSMASQ instead. On the phones (and in my DHCP) do I put the FreePBX server machine as the primary DNS server? All phones are on DHCP but with reservations in the router, so they always have the same IPs in a range I set for phones. Thanks again.

Just make sure that dnsmasq is not providing DHCP services, it does not by default and use 127.0.0.1 as your primary Nameserver, do not use secondary or more.