Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

My mac'c machine name is something like this: but whenever I connect to VPN, it becomes something like where xxxx are some random numbers. Because of this, some of my scripts which are dependent on host name gets blocked.

We use the standard mac's vpn setup which comes with OS X Lion (under network preferences).

How can I resolve to the correct mac's name even if I am on vpn ? That is even if I am connected to VPN, my machine name should resolve to and NOT to

Any suggestions would be really appreciated.

share|improve this question

migrated from Nov 26 '12 at 22:33

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

Have you tried manually setting the hostname on your workstation? Is the computer bound to an LDAP / Active Directory?

In a terminal run

sudo scutil --set HostName <yourhostname>

(Hostnames can be dynamically assigned via DHCP, which is likely what is happening, depending on how the VPN and internal network are configured, so setting the hostname by hand may not help.)

share|improve this answer

You must log in to answer this question.

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