Skip to main contentSkip to solution

Which of the following are valid IP address?

(A) 192.168.5.55

(B) 192.168.0.0

(C) 192.168.256.2

(D) 260.168.5.12

Solution

✅ Correct Option: 2

An IPv4 address has four decimal numbers separated by dots, and each number (octet) must lie between 0 and 255, since each is stored in 8 bits.

(A) 192.168.5.55 has all four octets within 0-255, so it is valid.

(B) 192.168.0.0 also has all octets within 0-255, so it is valid as a syntactic IP address. Here it is a network address, but it is still a well-formed IP.


(C) 192.168.256.2: the third octet is 256, which is above 255, so it is invalid.

(D) 260.168.5.12: the first octet is 260, which is above 255, so it is invalid.

An octet of 0 is allowed. The common trap is thinking 0 is not allowed, or that 256 is allowed.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question