You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal IP Address

Why is my terminal showing this:

user@[ipaddress] ~ %


When I'm connecting to my school network?


When I'm connecting to my home network, it does not show any ip address, just the normal computer name. I didn't ssh to it or anything. It just pops up as I connect to the network.


I tried removing the preferences.plist. But, after reboot its still the same after I connect to the network.


When I open up the sharing section in settings. The name is still my custom device's name.


Also, when I typed:

echo $HOSTNAME

It prints out a blank output

MacBook Pro 14″

Posted on Feb 21, 2023 8:24 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 22, 2023 3:13 AM

Your shell does a reverse DNS lookup using the current DHCP assigned IP address, and the local to your school DNS server replied with the information displayed.


When you are at home, generally your home router is your local DNS server, and it will reply differently.

5 replies

Feb 21, 2023 9:35 PM in response to hbdw_

hbdw_ wrote:

Why is my terminal showing this:
user@[ipaddress] ~ %

When I'm connecting to my school network?

When I'm connecting to my home network, it does not show any ip address, just the normal computer name. I didn't ssh to it or anything. It just pops up as I connect to the network.

I tried removing the preferences.plist. But, after reboot its still the same after I connect to the network.

When I open up the sharing section in settings. The name is still my custom device's name.

Also, when I typed:
echo $HOSTNAME
It prints out a blank output



try

echo $HOST 


you are logged into your University Network with name & password, you are not on your .local console on your own private network


The Network has you identified as user@[ipaddress] ~ % and communicating via that address


you can read more—

https://www.serviceobjects.com/blog/ip-address-vs-domain-in-an-email-address/



I am sure some of the experts can say more here...

Feb 21, 2023 10:22 PM in response to leroydouglas

Thank you for your reply.


But why is it different with when I'm connecting to a my home's network? Isn't the same, isn't the difference is just the authentication method? cause when I'm connected to my home network, it doesn't show the ip address that my device is assigned to.


I'm sorry if this is a novice question but I am not an expert in this field yet.

Terminal IP Address

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.