No Such Host (newbie)

Hi,
I have a really nasty problem configuring SIP gateway, I tried everything pls help.

ERROR:


Apr 10 13:11:49 WARNING[30266]: chan_sip.c:1973 create_addr: No such host: sip.mydomain.com
Destroying call '69bb43810815958b1c09228e0582a640@194.213.226.203’
Apr 10 13:11:49 NOTICE[30266]: app_dial.c:1012 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 3 - No route to destination)

I can connest to it with Xlite phone so it is ok, I can also ping it form server.

sip.conf:
[sip.mydomain.com]
type=friend
allow=all
context=from-sipgateway
host=sip.sparvoip.de
;outboundproxy=sip.soip.de
fromuser=
canreinvite=no
username=
secret=
;port=5060
;nat=yes
dtfmode=rfc2833
;dtmband=inband

extensions.conf

[phones]
exten => 2001,1,Dial(SIP/2001)
exten => 2002,1,Dial(SIP/2002)
exten=>500,1,Answer()
exten=>500,2,Hangup

exten =>_X.,1,SetCallerID()
exten =>_X.,2,Dial(SIP/${EXTEN}@sip.mydomain.com)
exten =>_X.,2,Hangup

[from-sipgateway]
exten=>_X.,1,Dial(SIP/2001&SIP/2002)

Try one of these two possible resolutions.

or

  • change sip.mydomain.com to ‘myprovider’ (or any other name, not formatted like a dns name).

** Don’t forget to change both sip.conf and extensions.conf.

SIP addresses are in the format, number@domain, just like email. When the domain portion is a fully qualified domain name, it appears that Asterisk is trying to resolve the IP of that fqdn. sip.mydomain.com is not going to resolve because it a bogus fqdn, which is what causes the error to be generated. Either make the fqdn resolve properly or change the domain part to something that isn’t a fqdn, and Asterisk should handle it properly.

Dan

Sorry for confusinf post - I replaced sparvoip.de to maindomain.com for clearing the prsenstation (but not in each line so I confused You)
Normally all mydomain.com is sparvoip.de and The problem is the same:

cannot find host : sip.sparvoip.de despie it works from xlite, and I can ping it from server

You might want to try running ‘dig sip.sparvoip.de’, to make sure that your machine can resolve the dns name properly.

Have you tried replacing the domain name with the IP address in your config files?

Dan

dig resolves domian without problems.
however when I changed hostname to IP - it connested to sparvoip but rejected due to wrong passsword - I will try to solve it now myself.

however it is not nice to enter IPs instead of names, because later on it can mess.

Thanks for help, ofcourse if You know what to do in order to enter names instead of IP’s I will be grateful.

thx.
Kuba

I saw that this domain has more one IP - amd it changes the default IP, may it be that srvlooku in asterisk works wrong as it selects always the first form list? is there any fix for it?

The multiple IP’s could be causing a problem. I’d recommend posting a new question on the developer’s forum.

Dan

thx

Add sip.mydomain.com with the correct IP address to your /etc/hosts file.

the problem is that there is no “correct ip” DNS resolves 5 different IPs with different priorities, each time You can get different accoridng to pririty, If You try to connect via others You will be rejected.

“ofcourse if You know what to do in order to enter names instead of IP’s I will be grateful”.

Well, ok, here’s how…

If you know the IP address that you said worked, put it in the “etc/hosts” file, then your computer will not use DNS to resolve sip.mydomain.com, it will always use the same IP address from the etc/host file that you specified for sip.mydomain.com.

For example, say 167.123.123.123 is the address you said worked, and sip.mydomain.com is the correct domain name, add the following to your etc/hosts file:

167.123.123.123 sip.mydomain.com

something sounds wrong here. there is nothing wrong with having multiple IPs for a single name. The “no route to host” sounds almost like one (or more?) of the names have bogus mappings. If so, that’s the problem, no?

True, but a lot of providers have many IP addresses accross the country. You should ALWAYS ping the addresses, and use the one(s) with the fastest response time.

For example, If you lived in LA, would you want to use a NY IP address for your gateway???

true, but completely irrelevant to the OP’s problem.

There maybe timeout problems, you never know your response time from those resovled DNS addresses.

Besides, why not do it the right way to begin with, and set the correct IP for your area in /etc/hosts?

because that isn’t the right way. why even bother using DNS then? if you are using any kind of internet service with geographically diverse servers, such that latency IS an issue, the provider should not be mapping these servers onto the same name. granted that’s beyond the OP’s control, but still

also, this has nothing to do with a timeout - “no route to host” has a very specific meaning, per RFC…

Well, I have to strongly disagree, it is the right way…

Most providers provide many addresses, they don’t know their clients locations, and they recommend pinging, and using the IP with the fastest response time. Unless of course, they don’t use round robin, and have many host records for each area, such as ny.provider.com, la.provider.com, west.provider.com, east.provider.com, ect…, then ping wouldn’t be needed.

But anyway, this isn’t a thread on networking 101, nor my thread, so I will politely be quiet. I was just trying to help.

Please note, that this “no root to host” also appear when I enter IP - one of the IPs form list but no the “best” one instead of name.
Please also note that this “best” IP changes for me every 10 minutes despite I dont change my geografical location. (-:

So they obviously have an unreachable server listed in DNS. Their service is broken and they need to fix it.

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: