In the days of modern internet connections, you’re almost certainly using a router. Routers are different and may offer you a static or dynamic internal address for use on your LAN. This article will tell you how to tell the difference between a static and dynamic IP address using the Linux terminal emulator.
So, I’m going to assume you know what an IP address is. It’s basically the numbers used to indicate a specific computer, though it’s a bit more complicated and you can read the Wikipedia page on IP addresses if you want a more detailed explanation.
A dynamic IP address is an IP address that changes from time to time. A static IP address is one that doesn’t change. The first one will be different after a set amount of time or events, the second one will always be the same.
The benefits of a static IP address are many, chief among them is consistency. This is true even on a LAN (Local Area Network). If you don’t recall the device name, you can easily access it by IP address. If the device doesn’t have a hostname, you can access it by IP address, and the address doesn’t change.
The benefits of a dynamic IP address are pretty much none, unless you’re a provider who wants to rotate through them because of constantly changing devices. For you my delightful reader, in your realistic use-cases, there are no real benefits to having a dynamic IP address. They’re a great idea when you have more devices than you have IP addresses – which is very unlikely to be true if you’re reading this site for Linux tips!
NOTE: Your Linux distro probably happily works with .local. So, if you have a dynamic address you can still access it through hostname.local. For example, this computer is ‘kgiii-desktop’ and I can access it with ‘kgiii-desktop.local’ easily enough.
Anyhow, it’s pretty easy to tell. The first thing you need to do is crack open your terminal. You can do this by pressing
Now, just look for ‘valid_lft’ and you’ll have your answer.
If it’s a dynamic IP address you’ll see something similar to this:
If it’s a static IP address, you’ll see something similar to this:
See? I told you that it was pretty easy! Now that you know, you can easily check and act accordingly. As always, thanks for reading. Don’t forget to sign up for the newsletter. You’ll get an email when a new article is published and make an old man happy!