Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My mac'c machine name is something like this: hostname.company.com but whenever I connect to VPN, it becomes something like vpn-xxxx.company.com 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 hostname.company.com and NOT to vpn-xxxx.company.com.

Any suggestions would be really appreciated.

share|improve this question

migrated from stackoverflow.com Nov 26 '12 at 22:33

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

1 Answer 1

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

Your Answer

 
discard

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.