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.

I just transfered all of my files and settings over to a new laptop using Migration Assistant (on a mac). The name of my computer in terminal is wrong for some reason. It's unknown20c9d042dc93

The prompt looks like this

Last login: Thu Jul 19 19:46:15 on ttys001
unknown20c9d042dc93:~ Ryan$ 

How do I change the name to what it usually is, Ryan's Macbook?

share|improve this question

migrated from stackoverflow.com Jul 20 '12 at 0:08

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

2 Answers 2

The value of the $HOSTNAME variable (which is actually what you're seeing there) is determined by a reverse DNS lookup of your IP address.

Which ever DNS server your Mac is configured to use has that in its database.

You can demonstrate this with the following command:

dig +short -x $(ipconfig getifaddr en0)

Use en1 if you're on WiFi instead of wired.

share|improve this answer
    
That doesn't tell me how to fix it, I've tried restarting my router and my computer and that didn't fix anything –  user1036238 Jul 24 '12 at 2:03
    
You need to edit the DNS zone and edit or remove that record. –  bahamat Jul 24 '12 at 18:34
    
how would I do that? –  user1036238 Jul 24 '12 at 23:16
    
If it doesn't match what's in the Sharing preference pane and you don't know where to edit the zone file then you probably don't have access to do so. Try wandering around in your router config (if you have one, if not talk to your administrator). –  bahamat Jul 25 '12 at 0:14

OS X gets a name from one of several places, depending on whether you're hooked up to a network and what you have and haven't configured. One place you can set it is in the System Preferences under "Sharing" where it says "Computer name" on the top. Also, under the "Network Settings", under "Advanced", look at the "WINS" tab where it shows the "NETBIOS Name".

share|improve this answer
    
I've checked in sharing and the advanced network settings and they're both correct but the name in terminal is still wrong –  user1036238 Jul 24 '12 at 2:03

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.