I would like to be able to SSH into my macs over the internet using a DNS name like my-imac@example.com or something similar instead of having to enter an IP address every time. How can I assign domain names to my computers so I don't have to use the IP address to access them anymore? Any insight would be appreciated!


You need to go a domain registar, and register a domain name with them. You then create an A record to point to your IP address with whomever is hosing the DNS servers that are hosting your domain (this may or may not be your registar) - after that, simply use the domain name in place of wherever you'd use the IP address.

Some websites, like DynDNS, do half the work for you. They have already registered a domain and set up the DNS servers, and then hand out subdomains. You can't get example.org with them, but you can get example.dyndns.org to point to your IP address for free (the other way costs about $10/year depending on the type of domain name you go with). All you have to do is sign up at the website and pick a subdomain name and enter your IP to get started :)

  • what about if your IP is dynamic? – user4951 Jun 8 '13 at 16:33
  • 2
    You need to install an Update Client. – Karan Jun 8 '13 at 23:03

You could sign up for DynDns: http://dyn.com/dns/

That's how I've done ssh to my machine in the past. I believe they have a free version that allows you to have at least one domain name.

It's particularly nice because of the features they add such as the "Internet Guide" which allows for some content restriction control.

  • 1
    They have a free version that allow you to register up to 2 machines. That's what I use. – fmanco Jun 21 '12 at 21:00
  • @criziot: Oh good! That's even better. – Ci3 Jun 21 '12 at 21:02

If you have a static IP, you can assign an alias for your ip in the /etc/hosts file: localhost
xx.xx.xx.xx alias.whatever

If you have a dynamic IP, you could use the service by sites like http://www.no-ip.com/ to get a subdomain.

  • +1 I do this all the time... and in windows, hosts is under system32/drivers/etc/. I don't bother with a . in the alias. So I always have work as "work". Some more goodies to look in to are .ssh/config, where you can include the IP address in a host entry, along with target username and/or use a specific key. – Chris K Jun 21 '12 at 22:31

Assuming you mean over the internet, I would use godaddy.com if you have a static IP address. Static IP address means your IP does not change over time.

If you have a dynamic IP address I would buy your domain through godaddy.com then point the Nameservers to dnsexit.com. They allow you to use all the free dynamic domains you want.

  • Static IPs from "home" connections are very-super-rare. So, any solution based on static IP is doomed to failure. – killermist Jun 22 '12 at 5:50
  • I have a static ip at home. It wasn't even a chosen option. I have had pretty much the same ip since the 2 years I've had this service. – alexander7567 Jun 22 '12 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.