
In essence, an IP address is a numeric address of a computer network or a single computer. Public IP addresses are assigned by their respective organizations. Most computers, referred to as hosts from now on, have two to three IP addresses. Each of these have a certain meaning to other hosts it might communicate with. If you have a router, all of the information exchanged between local devices and external hosts will go through your router.
This IP address is used by your own computer when communicating with itself through transfer protocols.
All computers--regardless of operating system--have a self address, 127.0.0.1 or localhost in it's more readable form. This number is reserved as such for this purpose in the available IP addresses. Calling localhost or 127.0.0.1 in an Internet transfer protocol will tell the server software you are referring to itself. This is used in software such as web server, mail server, FTP server, etc. Unless you are a web or systems developer, this probably has no meaning to you.
This IP address is assigned and used by your router to route information to and from your host. The range depends on the router but common ranges tend to be:
If, according to your router, the IP address of your computer is 10.0.0.3 and your printer is connected to the network at 10.0.0.7, the two will use these numbers to communicate with each other, with the router mediating--or "routing", if you will--the traffic between the two. The router's local IP might be 10.0.0.1 which you might call in a web browser--through a host connected to the local network--to modify its settings.
This is the IP given to the outside world assigned by your Internet Service Provider, should it be requested, when you browse the web, check your e-mail, or download a file. Your Internet Service Provider is assigned a block of IP addresses it can give out by respective organizations in charge of controlling Internet numbers, names, and protocols.
This is given out to external hosts you communicate with for information. This allows the external host to send back the information you requested to the correct address. After this, your router will route it to the proper device within its local network that requested the information.
All home and office networks connected to the Internet have one of these, including web servers.
All domains can be reverted to an IP address. Domain names are simply human-friendly forms of referring to a host at an IP address. What's easier to type and remember, 209.85.227.106 or google.com? Additionally, 69.63.187.19 = facebook.com, 209.191.93.53 = yahoo.com, and so forth. Domains are matched with IP addresses using name servers when you register your domain.
PHP can convert domain names to IPs:
<?php echo gethostbyname('www.example.com') ?>
There are many web services out there for tracing an IP, the most accurate I've found to be is Maxmind. With the address, one can get the city, country, ISP and other details of the IP address. This information is retrieved from a database of IPs, each with specific information about that IP. This is an important step in tracing unlawful online activity. Once the ISP is discovered, they may be contacted accordingly providing the violating IP address.
This is sometimes also used to detect whether the user is coming from the correct connection, such as Hulu which limits their content to users (ip addresses) of specific countries.
This is not full proof as someone can easily browse the web through a proxy server and give out the address of the proxy server instead of their own, real IP address, making the owner of the proxy server responsible for all activity.
With a little PHP, we use htmlspecialchars() in this case to prevent any malicious code from being executed upon the echo function.
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$host = gethostbyaddr($ip);
echo htmlspecialchars("$ip ($host)");
?>
Your IP & Domain:
38.107.191.89A user agent string details the browser and system accessing the web page. They range from Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) to Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2. They are not limited to laptops or desktops, many search engine crawlers specify identification information in their user agent string.
Again, we use htmlspecialchars() in this case to prevent any malicious code from being executed upon the echo function.
<?php echo htmlspecialchars($_SERVER['HTTP_USER_AGENT']); ?>
Your User Agent:
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
3 Comments
Jamaipanese
7 mo. ago
very good post, I already knew some of this but it was good to freshen up my mind and learn a few new things about IP adresses
Thank you, Kirk; glad you learned something. Indeed, IP addresses can get even more complex once you begin discussing ports as well. Please stop by anytime.
Omar Maya
7 mo. ago
Reply
xRommelx
7 mo. ago
hey really interesting blog, i wish you te best
sorry for my english, is not so good hehehe
What's on your mind?
Gravatar