IP Address Assignment: How are IP Addresses Assigned?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
10 replies · 3K views
Messages
7,819
Reaction score
13,151
Hi All,
I am just curious. I am in a coffee shop using the internet. My (external) IP address in this coffee shop ( given by whatismyip.com) is the same as the IP address assigned to me at home by my ISP. I thought IP addresses are assigned dynamically when one logs into a network and the network used by the coffee shop is not the same as that of my ISP. How is that so? Doesn't a DHCP server assign an address dynamically when I log in and then remove it from circulation when I log of ?
Thanks.
 
Last edited:
Physics news on Phys.org
  • Like
Likes   Reactions: WWGD
Perhaps try again, but before doing so clear your cache.
 
  • Like
Likes   Reactions: WWGD
This could happen if you are using a proxy browser.
 
  • Like
Likes   Reactions: WWGD
Or even try a DNS flush. Instructions can be found doing a quick google.
 
  • Like
Likes   Reactions: WWGD
WWGD said:
Hi All,
I am just curious. I am in a coffee shop using the internet. My (external) IP address in this coffee shop ( given by whatismyip.com) is the same as the IP address assigned to me at home by my ISP. I thought IP addresses are assigned dynamically when one logs into a network and the network used by the coffee shop is not the same as that of my ISP. How is that so? Doesn't a DHCP server assign an address dynamically when I log in and then remove it from circulation when I log of ?
Thanks.

Specific answer to your questions:
IP addresses can be set static, but if you had set your IP address static, you'd probably know. And, if you'd set it static, you wouldn't be able to connect at the coffee shop. Your IP address is most likely assigned via DHCP. Those are assigned when requested by your device, and made available again when your device is no longer connected. As a general rule, no two networks should hand out the same IP address. There is however, an exception.

Most small private networks use a non-routable subnet starting with 192.168.x.x for connected devices. You didn't mention what your IP address was, but I would be willing to bet its 192.168.x.x - if that is the case, then it's entirely possible that you got the same address at home and at the coffee shop - but because the address is non-routable, only the network you are communicating with can route to you. In that case, it is perfectly reasonable (although maybe lucky) that you got the same address at home and at the coffee shop.

If the IP address you have isn't 192.168.x.x then you most likely have a Proxy configured (Fervent Freyja's answer) or a VPN configured. In both these cases, the IP address you are seeing was handed out by a different source than your home or coffee shop, and the lease might persist longer.
 
  • Like
  • Informative
Likes   Reactions: Wrichik Basu, MikeeMiracle, jedishrfu and 1 other person
StevieTNZ said:
Perhaps try again, but before doing so clear your cache.
Thank you, this has worked a few times. In case anyone else using Windows has trouble accessing the web, go to the
CMD line and type :
ipconfig/flushdns
 
WWGD said:
Thank you, this has worked a few times. In case anyone else using Windows has trouble accessing the web, go to the
CMD line and type :
ipconfig/flushdns
Don't forget to put a space before the '/', else it won't work!
 
  • Like
Likes   Reactions: WWGD and OCR