I’ve been a silent user of Virtualmin for about 6 years now! But I only started using BIND DNS server last night. BIND is running perfectly on my server and all my domains are resolving.
Now, what I want to do is very simple: I’d like my DNS to resolve a non-existing subdomain of one of my domains to an outside IP address (for example resolve myhome.domain.com to the static IP of my home network).
Why do I want to do this? So that from outside home I could do (e.g.) ssh myhome.domain.com rather than ssh 111.222.33.44 (assuming that’s the static public IP of my home’s network).
The simplest would be to just add a DNS record on the domain you want to use - this is done under Server Configuration -> DNS Records.
Just click Create Record of Type (A) -> enter what you want to use as subdomain and the IP address of your home network.
Yes, correct. However you might not want to advertise your home IP address publicly, and could use local /etc/hosts file (on PC from which you’re trying to access your remote, home server).
Wow talk about overthinking it. Duh… of course the simple way is to add the A-record! (I don’t know why I wasn’t realizing it!!).
The solution with the host file is valid, but as toreskev pointed out I want to switch from computer to computer from time to time.
Also, creating entries in ~/.ssh/config is exactly what I’ve been using thus far. But since I started using my own DNS server I thought why not just give it a public name.
Thanks again, I added the A record and it’s working as intended.