No Such Host (newbie)

[quote=“MaVac”]Hi!
I just started to connect my Asterisk to SIP service provider and have the same problem.

[ul]
Apr 14 21:38:08 NOTICE[12289]: chan_sip.c:5285 sip_reg_timeout: – Registration for '420222502969@viphone.cz@viphone.cz’ timed out, trying again (Attempt #1)
marfa*CLI>
Apr 14 21:38:09 WARNING[12289]: chan_sip.c:1973 create_addr: No such host: viphone.cz
Apr 14 21:38:09 WARNING[12289]: chan_sip.c:5368 transmit_register: Probably a DNS error for registration to 420222502969@viphone.cz@viphone.cz, trying REGISTER again (after 20 seconds)
[/ul]

I can ping the host “viphone.cz” and get resolved IP:
[ul]
root@marfa:/home/mavac# ping viphone.cz
PING tea.superhosting.cz (80.79.21.4): 56 data bytes
64 bytes from tea.superhosting.cz (80.79.21.4): seq=0 ttl=58 time=10.3 ms.
64 bytes from tea.superhosting.cz (80.79.21.4): seq=1 ttl=58 time=10.9 ms.
64 bytes from tea.superhosting.cz (80.79.21.4): seq=2 ttl=58 time=9.34 ms.
64 bytes from tea.superhosting.cz (80.79.21.4): seq=3 ttl=58 time=9.43 ms.

---- tea.superhosting.cz (80.79.21.4) PING Statistics ----
4 packets transmitted, 4 packets received, 0% packet loss
[/ul]

What the hell is wrong?? :imp:[/quote]

!!!SOLVED!!!
Tho problem was with SRV-record lookup!! My provider has no SRV record!!! Bingo!!! :smiley: :smiley:

Comment the srvlookup=yes in sip.conf and it will work!!!

Thanks for the reply !!!

Helps others to solve it reading your solution, nice !

Naughty provider… :smiling_imp:

I would say most VOIP providers don’t provide SRV record at all, which Asterisk works fine, no problem.
And, even if you did enable srvlookup=yes (the default), Asterisk will work just fine. It will look for SRV records, but if none were found, it will just use the A record for the server address.

You say, why did MaVac have a problem?

I think this is a rare case, but the domain “vipphone.cz” DNS records are confusing Asterisk.
First, notice that “viphone.cz” DNS resolves to IP address 80.79.21.4, but the arpa PTR record for 80.79.21.4 returns “tea.superhosting.cz”.

Now here is the problem.

superhosting.cz resolves any host, even “_sip._udp”!!!
Such as blahblah.superhosting.cz, sd3d8ddblah.superhosting.cz
And, since _sip._udp.tea.superhosting.cz is resolving, Asterisk assumes it contains valid SRV records. However, it DOES NOT contain any SRV records at all, which is confusing Asterisk…
Asterisk assumes if a _sip._udp. resolves, it will contain SRV records!!!
Of course, if “vipphone.cz” was in his /etc/hosts file, I don’t think this problem would not occur, since his Linux box would resolve 80.79.21.4 to vipphone.cz, not tea.superhosting.cz which has a problem resolving everything, including _sip._udp with no SRV records. And vipphone.cz does not resolve bogus host names, or _sip._udp.

And of course, if MaVac did have other providers or user domains as well, and they used SRV records, comment out srvlookup=yes would not be a good idea.
And please take note, I’m not telling anyone to rush out and change their ect/host file!!!

MaVac problem DNS, resolves _sip.udp but no SRV records!!

[root@linux-1 ~]# nslookup
> set type=SRV
> _sip.udp.tea.superhosting.cz
Server:         192.168.0.50
Address:        192.168.0.50#53

*** Can't find _sip.udp.tea.superhosting.cz: No answer

>
>
> set type=A
> _sip.udp.tea.superhosting.cz
Server:         192.168.0.50
Address:        192.168.0.50#53

Name:   _sip.udp.tea.superhosting.cz
Address: 80.79.21.4
>

Normal Results for domain not containing SRV records


> set type=SRV
> _sip._udp.broadvoice.com
Server:         192.168.0.50
Address:        192.168.0.50#53

** server can't find _sip._udp.broadvoice.com: NXDOMAIN
> set type=A
> _sip._udp.broadvoice.com
Server:         192.168.0.50
Address:        192.168.0.50#53

** server can't find _sip._udp.broadvoice.com: NXDOMAIN
>

Normal Results with SRV records


[root@linux-1 ~]# nslookup
> set type=SRV
> _sip._udp.cape.com
Server:         192.168.0.50
Address:        192.168.0.50#53

Non-authoritative answer:
_sip._udp.cape.com      service = 0 0 5060 vgw-3.cape.com.

Authoritative answers can be found from:
vgw-3.cape.com  internet address = 69.7.11.18
>
> set type=A
> _sip._udp.cape.com
Server:         192.168.0.50
Address:        192.168.0.50#53

*** Can't find _sip._udp.cape.com: No answer
> 

Thanks guys, this was also throwing me with sipphone registration. Didn’t think to check for services resolving. Much better then hacking /etc/hosts.

Ta

  • David