I've noticed that various services for this IP 85.222.136.21 returns different AS numbers.
For example, http://bgp.he.net/ip/85.222.136.21#_ipinfo says AS14340
, while on the Whois section, there it says AS15982
. Why is that?
I've also asked my friend from different continent to run a traceroute with AS number resolution and he got AS14340, while on my machine it resolve to AS15982.
There is nothing to force routing information in whois to match up with what is actually in the routing tables.
Also there is nothing in BGP that prevents a single prefix being originated from more than one AS.
In this case I would guess that at some point the originating AS for the prefix was changed but noone got arround to updating the routing information in whois.
As you've discovered, there are different ways to determine what ASN an IP address is associated with. In general, you can look in three places:
Real-time (or historic) BGP (global routing) data
Routing Registry records
IP allocation / assignment records
Also, to add confusion, there can be several origin ASNs in #1 and overlapping records in #2. It's possible to overlapping in #3, but less likely as long as you stick to the most specific.
The difference in results you are experiencing is a combination of:
where you (or your tool is) looking things up
if there is overlap ...and if so, what your tool does to decide which one to display
Where to look?
Depends. The most accurate of what's live in the wild is BGP itself (#1). Just keep in mind it can change. The first link you provided is based on a snapshot from BGP. You can use a looking glass for real-time information from a particular network's perspective.