I have a linux server on my home network which uses Dynamic DNS provided by noip.com, and a corresponding hostname "xxxx.hopto.org". From outside of my network, say, at a coffee shop, I can use this hostname to ping or to SSH into my server. However, when I'm on my local network, I cannot ping or SSH into my server using the hostname. Running host
shows that the hostname of my server resolves to its public IP, which is the same as my machine's public IP:
MacBook-Air:~ user$ host xxxx.hopto.org
xxxx.hopto.org has address 47.6.24.149
MacBook-Air:~ user$ curl ipinfo.io/ip
47.6.24.149
My background does not really include networking concepts, but I can see two potential solutions to this problem:
- Force the hostname to resolve to the local (static) IP address when I'm on the same network as the server.
- Somehow give my server it's own public IP address.
How would I do one (or both) of these? Is there another solution that would be easier/better? Thanks for your help.