example.com is OK for domain example, what is example IP Address?

The blocks 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2), and 203.0.113.0/24 (TEST-NET-3) are provided for use in documentation.

From rfc5737


There is no law against (ab)using someone elses domain or IP address in examples, but it is a very bad idea. As some uses will use your example values verbatim.
For example, the IP address 1.2.3.4 have been used in examples. But that is live real IPv4 addresses that are used in 1/8 as valid global IPv4-prefix. There are already some concerns about this use of that address in examples.

RFC5737 is about IPv4 addresses used for examples, which are any address in networks 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2) and 203.0.113.0/24 (TEST-NET-3), like 192.0.2.10, 198.51.100.3 or 203.0.113.254. These doesn't exist on Internet.

Three IPv4 unicast address blocks are reserved for use in examples in specifications and other documents. This document describes the use of these blocks.

RFC3849 is about IPv6 addresses used for examples, which are any address in 2001:db8::/32. These are are also not used on Internet.

The document describes the use of the IPv6 address prefix 2001:DB8::/32 as a reserved prefix for use in documentation.

RFC2606 is about reserved TLD:s for different use. Those are ".test", ".example", ".invalid" and "localhost". Any domain under those can be used, like "a-host.example"
"test" is used for testing, "example" for documentation, "invalid" in configuration files that needs to be tweeked and "localhost" for 127/8 (mostly 127.0.0.1). There are also three reserved second level domains to be used for example domains (example.com, example.net and example.org).

To reduce the likelihood of conflict and confusion, a few top level domain names are reserved for use in private testing, as examples in documentation, and the like. In addition, a few second level domain names reserved for use as examples are documented.

RFC1918 is about the private network addresses 10/8, 172.16/12 and 192.168/16. Those are private and should not exist on Internet, so they might be used for example networks. But it's better to use the other reserved IP addresses mentioned above, as they will not conflict with real private network use in users LAN setup.

This document describes address allocation for private internets. The allocation permits full network layer connectivity among all hosts inside an enterprise as well as among all public hosts of different enterprises.

RFC3330 should be of interest as an overview of all special IPv4 networks.

This document describes the global and other specialized IPv4 address blocks that have been assigned by the Internet Assigned Numbers Authority (IANA).


Can example.com IP Address used for this purpose legally?

Any IP address can be used as an example legally - there's no law that would prevent you from doing that. Using one of the private ranges or an invalid one (making any of the four numbers greater than 255) will prevent anyone accidentally flooding someone's IP with an infinite loop or something based off your examples.