0

I just added my no-ip domain to /private/etc/hosts under a shorter alias:

alias host.no-ip.biz

I tried the following on the shell:

dscacheutil -flushcache

but it still says:

ssh: Could not resolve hostname

What up with that?

  • downvoted question -- surprise surprise. great job stack overflow. – Walrus the Cat Jul 3 '13 at 18:29
  • 1
    Some people down vote for too many words, others for too few words, and on a lower traffic site like this, it's possible it will take 4 months to get the views of people who appreciate the question and answer enough to up vote it. – bmike Jul 3 '13 at 21:38
  • @WalrustheCat agreed. I upvoted. – MikeSchinkel Jul 3 '13 at 21:39
  • <entering 15 characters> OTY! – Walrus the Cat Jul 5 '13 at 3:52
2

/etc/hosts can't be used for that:

/etc/hosts cannot be used (by itself) to produce hostname "aliases".

The hosts file produces the internal equivalent of A and PTR records from the DNS, i.e. mapping of hostname to IP address and vice-versa.

It cannot be used to produce the same effect as a CNAME record.

You can make ssh alias equivalent to ssh host.no-ip.biz or ssh username@host.no-ip.biz by adding lines like this to ~/.ssh/config:

Host alias
HostName host.no-ip.biz
# User username

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .