1

5 minutes ago, my server was unable to find route to api.twitter.com. mtr showed a blank screen. /etc/init.d/networking restart fixed the problem but I would like to understand what went wrong so that I can troubleshoot it more precisely next time. Any ideas ?

UPDATE : here is what the host command shows:

host api.twitter.com
api.twitter.com has address 199.16.156.199
api.twitter.com has address 199.16.156.40
api.twitter.com has address 199.16.156.104

after flushing the cache, one route changes:

host api.twitter.com
api.twitter.com has address 199.16.156.40
api.twitter.com has address 199.16.156.104
api.twitter.com has address 199.16.156.231
greg0ire
  • 316
  • 1
  • 6
  • 26

1 Answers1

1

As you can see api.twitter.com has a multiple A records

# host api.twitter.com 216.187.125.130
Using domain server:
Name: 216.187.125.130
Address: 216.187.125.130#53
Aliases:

api.twitter.com has address 199.59.150.9
api.twitter.com has address 199.59.149.199
api.twitter.com has address 199.59.149.232

# host api.twitter.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

api.twitter.com has address 199.16.156.199
api.twitter.com has address 199.16.156.72
api.twitter.com has address 199.16.156.231

So it is possible that one node of the "cluster" has failed and all packets tried to reach failed node. As you can see each route has TTL

# ip ro get 199.59.150.9
199.59.150.9 via 209.15.xxx.xxx dev em1  src 209.15.xxx.xxx
    cache  mtu 1500 advmss 1460 hoplimit 64

# ip -s route show cache 199.16.156.231
199.59.150.9 via 209.15.xxx.xxx dev em1  src 192.168.207.10
    cache  users 1 used 38 age 17sec ipid 0x7f34 mtu 1500 advmss 1460 hoplimit 64
199.59.150.9 from 209.15.xxx.xxx via 209.15.xxx.xxx dev em1
    cache  users 1 age 20sec mtu 1500 advmss 1460 hoplimit 64

I think you can use the following command to clean your cache

# ip route flush cache 199.59.150.9

You can get more info at http://vincent.bernat.im/en/blog/2011-ipv4-route-cache-linux.html

ALex_hha
  • 7,025
  • 1
  • 23
  • 39
  • Interesting. If fails again, I'm going to update my answer with what I get with `host` – greg0ire Feb 20 '14 at 10:30
  • flushing the cache does work – greg0ire Feb 20 '14 at 10:33
  • the problem keeps coming back though. It looks like twitter is having problems: https://dev.twitter.com/status – greg0ire Feb 20 '14 at 12:23
  • Please have a look at this question : http://serverfault.com/questions/578122/linux-caches-route-with-ips-of-machine-it-has-no-access-to , I'm still struggling with this problem... – greg0ire Feb 25 '14 at 16:30