0

I am wondering how, on a technical level, IPv4s and domains can be distinguished.

An IPv4 takes the form [0-255].[0-255].[0-255].[0-255].

A domain takes the form (a)+.b, where (a)+ denotes that this string occurs at least once and may repeat.

The values of a can be considered arbitrary alphanumericals (so yeah, mathematically, I am not super correct with the expression above), as can the values of b, though b has practically more restrictions because it must usually be registerd Top Level Domain (TLD), but apart from that, may be arbitrary alphanumericals, either.

In theory, the set of ip addresses looks like a subset of the set of domain addresses.

Edge cases like special characters and special addresses are not relevant for this question and can be ignored.

When I enter an IP or domain into my browser address field, the terminal, or an application, how does the system know whether I entered a domain that requires resolution, or an IP address that can be directly contacted?

Can someone, on a technical level, explain how the system handles these strings and what possible interactions can occur and whether (and why) this raises security issues, or not?

I was wondering, whether an attacker would be able to exploit this ambiguity and whether there are cases where exactly this already happened in the past.

  • Your question is offtopic here as not related to programming. But in short a "domain name" in DNS specifications is any string with just some length limits but no characters exclusions. So an IP address is a domain name in that sense. Your point is addressed in ยง2.1 of RFC 1123. Or look at my extended answer at https://stackoverflow.com/a/53875771/6368697 โ€“ Patrick Mevzek Oct 14 '22 at 14:48
  • Also to nitpick, a TLD is a domain name and it wouldn't match your `(a)+.b` expression. Also please don't be caught in legacy old Internet, and remember that today IP addresses should be IPv6 ones. โ€“ Patrick Mevzek Oct 14 '22 at 14:49
  • I am caught in reality, where IPv4 is widely used ;) Thanks for the link! โ€“ kaiyazeera Oct 18 '22 at 11:46

0 Answers0