gmc
Posts: 123
Joined: Fri Mar 09, 2012 11:31 am
Location: Cheshire, UK
Contact: Website

Telnet resolves a different IP?

Fri Sep 07, 2012 11:40 pm

Got a strange one. Been having problems with sabnzdb connecting to news servers and it looks like a resolution issue on the pi.

Running:
Linux raspberrypi 3.2.27+ #114 PREEMPT Tue Sep 4 00:15:33 BST 2012 armv6l GNU/Linux

If I ping news.astraweb.com the address resolves to 216.151.153.61

If I telnet news.astraweb.com 119
it resolves to:
Trying 8.17.249.101...

Whats up with that?

lseidman
Posts: 15
Joined: Fri Sep 07, 2012 7:31 pm
Location: Las Vegas, NV
Contact: Website

Re: Telnet resolves a different IP?

Sat Sep 08, 2012 12:43 am

This could be a few things, but I think it has nothing to do with the Pi. This would have to do with the host. Most likely it's using Port Forwarding.

Code: Select all

/* Thanks,
 * Lance
*/

User avatar
jojopi
Posts: 3268
Joined: Tue Oct 11, 2011 8:38 pm

Re: Telnet resolves a different IP?

Sat Sep 08, 2012 1:20 am

gmc wrote:If I ping news.astraweb.com the address resolves to 216.151.153.61
If I telnet news.astraweb.com 119 it resolves to: Trying 8.17.249.101...
"sudo apt-get install ldnsutils" will give you a program "drill" that can query DNS servers directly:

Code: Select all

pi@tau ~ $ drill news.astraweb.com
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 7985
;; flags: qr rd ra ; QUERY: 1, ANSWER: 8, AUTHORITY: 2, ADDITIONAL: 2 
;; QUESTION SECTION:
;; news.astraweb.com.   IN      A

;; ANSWER SECTION:
news.astraweb.com.      5       IN      A       207.246.207.165
news.astraweb.com.      5       IN      A       207.246.207.168
news.astraweb.com.      5       IN      A       216.151.153.32
news.astraweb.com.      5       IN      A       216.151.153.59
news.astraweb.com.      5       IN      A       8.17.249.104
news.astraweb.com.      5       IN      A       8.17.249.105
news.astraweb.com.      5       IN      A       8.17.249.106
news.astraweb.com.      5       IN      A       207.246.207.122
This is a form of load balancing. Their DNS server returns eight different IP addresses in round-robin order. Your client uses the first one. The time-to-live on the records is very short (5 seconds) so subsequent attempts will likely get a different IP.

In fact, in this case the set of records returned is changing all the time, rather than just the order. So their DNS servers may know the load on the machines they are balancing.

gmc
Posts: 123
Joined: Fri Mar 09, 2012 11:31 am
Location: Cheshire, UK
Contact: Website

Re: Telnet resolves a different IP?

Sat Sep 08, 2012 5:48 am

Thanks for the explanation. I thought I was losing my mind for a second. :)

Return to “Troubleshooting”