Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I configued my router to work with dyndns. Instead of using the dyndns hostname created by, I want to define my own host name, that in tern, refers to that dyndns hostname.

For example, lets say my dyndns hostname is, when I ping that address, it resolves to my ADSL router IP address, which is correct.

On my mac, I wish to use a shorter name, for instance, xNas, so that when I issue command "ping xNas", it uses the etc/hosts file and pings the dyndns hostname. But this isn;'t working. I added the following in /private/etc/hosts xNas

When I ping xNas, it returns

ping: cannot resolve xnas: Unknown host

How do I get this to work?

NOTE: I do not have a static IP address, I have ADSL, so my IP address changes.

share|improve this question
It's possible to do what you're asking, but by using a dns server, not with the hosts file alone. At least as far as I know. It would be a lot easier to use an alias or export if you were only using it in terminal. Otherwise, you need a dns server. I do this exact thing with DyDNS, but I use an externally hosted DNS server for the forwarding to the DyDNS name (which then forwards to the dynamic IP). – skub Jul 10 '13 at 0:55

You could do this with Search Domains, sort of.

If you go to your TCP/IP settings and add as a search domain then whenever you ping

ping fanix

It will first try to resolve fanix in your local domain - perhaps fanix.local and if it doesn't get a hit, it will then look for

This is one extra character than you were after, but saves the need for a DNS server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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