local workstation name in terminal?

kon21

Registered
how do I change the name my terminal window displays for my laptop?
Right now when I launch Terminal I get...

Welcome to Darwin!
[cujo:~] kon%

Where is it pulling the name "cujo"? I thought it was supposted to say "localhost".

thanks,
konrad
 
I would guess that its pulling the name down as a result of a reverse dns lookup. Whoever had your ip # before you must have had a computer named cujo.

If you have no idea where the name came from, then I would check with your isp to have the dns records updated.

If know what your ip # is, you can execute the following on in a terminal shell and it will show you the hostname associated with that ip number.

nslookup 192.168.0.1 (insert your ip number instead of the example I listed)

Another option might be to explore around the netinfo thingy that comes with Mac OSX. I am very new to Mac OSX (2 days) but I was looking around inside of it and it seems to control most of the services that are normally taken care of by the /etc conf files in other BSDish systems.

Hope this helps,

BSDimwit
 
Your right.
Just one weird thing.
On the 2000 DNS server the forward lookup zone had the right name with my IP. Then when I looked at the revers lookup zone that's where it had the "cujo" name. Why would it use a reverse lookup name?
By deleting the reverse lookup I got my correct DNS name to appear.

thanks.
 
While I have absolutely no experience with DNS on Win2k, I do know that with bind there are several ways to set up the DNS records for a certain zone. Let me show you my example and it might then make sense...


Lets say you are surfing and you ask to go to www.coolsite.com. You computer then figures out which DNS controls the coolsite.com zone. It then asks that DNS server, "Whats the ip address of www host in the coolsite.com zone. The DNS server then sends back the IP # so that the actual request can now take place from the server that is hosting www.coolsite.com.

Now in the case of your hostname. All your mac knew was the IP# your internet interface(nic card, modem, etc...) So in order to find out what hostname, your mac has to do a reverse lookup. But here is where it gets a bit different. Lets pretend that you have assigned 199.45.191.25 to your NIC card. Since it doesn't know your hostname, it has to use your ip number to figure out your hostname. Instead of figuring out which dns hosts the coolsite.com zone, it has to figure out who hosts the 191.45.199.in-addr.arpa zone file(which is probably the same DNS server as above, but doesn't have to be.) If you notice, the numbers I listed above in a reverse order to your pretend IP #... Why they do this, I don't know but thats the mechanism by with reverse DNS lookups happen. What I am trying to impress upon you is this... there are 2 separate zone files that reference your IP# and hostname, the forward and reverse.

As for Win2k, since you had a reverse zone enabled, it probably used it. After deleting that zone that said cujo, Win2k DNS probably used another mechanism to reverse the ip to your actual hostname. Maybe someone else with Windows DNS experience can chime in here.
 
that those make sence. My question is, how come the reverse lookup zone keeps muliple names to the same IP? Wouldn't it make sense for it to delete the old host name when it sees a new one with the same IP? Ofcourse if it is a duplicate IP with an IP that is currently live, it would drop the request to add it to the reverse lookup altogether.
 
In a reverse dns zone file, it is based on the ip number instead of the actual hostname. Perhaps its keeping multiple names to support virtualhosts that are using the same ip number, would have see it to know for certain.

On a Unix boxes running apache webservers, its possible to have multiple websites that use the same ip #. The webserver does some magic to determine which site to pull up by looking at the actual request string.

For example.

199.45.191.128 might reverse to www.coolsite.com
199.45.191.128 might also reverse to www.othercoolsite.com

the reason for this is to preserve IP #'s as there are only a finite amount.

To be honest, I am not certain how win2k maintains its zone files. However, DNS servers do what you tell them to do. If you have a zone file that says it has 2 hosts on one ip, it might just accept it advertise that lookup accordingly... though don't quote me on that.

Anyway, you seem to have the proper hostname coming up on your terminal shell so unless you are planning on running a DNS server on it too...
 
Back
Top