31

http://.................1168951531

Which, when put into chrome, previews to the URL http://69.172.200.235/, which redirects (by external server response code 3XX) to www.test.com, but that is outside the scope of what I'm trying to figure out.

How does such a weird URL like above resolve to an IP address? Is this a formatting rule?

  • 2
    Note that the same URL without the dots also works in Chrome: http://1168951531. But that begs the question, why does Chrome ignore the dots? – wjandrea Mar 2 '18 at 0:33
  • 6
    @wjandrea I'd guess Chrome interprets them as subdomains and doesn't actually ignore them. You can check that by viewing the Host-header of the request chrome sends. – Christoph Mar 2 '18 at 7:16
  • 1
    Bit of a tangent, but Gmail addresses allow you to add as many dots as you want, without causing problems, and also a + with whatever text after it you want. So abcd@gmail.com will also receive mail sent to a.b.c.d@gmail.com or abcd+junkmail@gmail.com - and a benefit is giving different emails to different sites to see who's putting you on the spam lists, or setting up rules to handle incoming mail different ways depending on the "To" address. (More) Or, kylesmom@gmail.com is now kylesmom+is.a.big.fa... – ashleedawg Mar 3 '18 at 7:24
  • For what it's worth, the combination of Firefox and squid does not allow this; Firefox passes the dots through verbatim, and squid errors because it's an invalid URL format. So this seems like a Chrome bug, or possibly the spec regarding empty domains is ambiguous? – Paul Gear Mar 27 '18 at 22:54
44

Chrome is interpreting the number 1168951531 as a decimal number, which when represented in hexadecimal is 45ACC8EB. 45ACC8EB in hex is the same as the dotted decimal 69.172.200.235, when you take each pair of hex digits as one decimal number.

45 -> 69
AC -> 172
C8 -> 200
EB -> 235

Short answer: It's the pure decimal representation of the same IP address.

| improve this answer | |
  • 4
    Firefox does the interpretation too (without the dots), but not Edge. – JAB Mar 1 '18 at 22:56
  • 11
    The typical source code to resolve a hostname is to first check if it is an IP address (e.g. with inet_addr()) and if not, pass it to a function like gethostname() that interrogates the DNS servers (and reads the hosts file). Passing a decimal representation of the IP address, as explained in the answer above, is perfectly legal in most implementations. I can type ping 1168951531 in a terminal, and it actually pings the intended address. It becomes more weird with all the dots in front, but possibly Chrome is removing them before attempting the resolution. – Ale Mar 2 '18 at 0:01
  • 1
    It's worth noting that both Chrome and Firefox accept the URL without dots. (http://1168951531) – Stevoisiak Mar 2 '18 at 22:04
3

This is a long representation of an ipv4 address of the ip 69.172.200.235. Which maps to www.test.com domain.

| improve this answer | |
  • 4
    Can you explain what a "long representation" is? – Philipp Mar 2 '18 at 8:46
  • 2
    It's better explained by the other answer, but it still boils down to the same thing. – Gothrek Mar 2 '18 at 9:00
  • 9
    Should probably be "long representation" – n0rd Mar 3 '18 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.