Basic question about terminal (the name that shows up after opening)

Discussion in 'macOS' started by ---, Jul 22, 2009.

  1. --- macrumors member

    Joined:
    Nov 1, 2008
    Location:
    Canada
    #1
    Just curious as to why every time I open Terminal, there is a different name preceding ~John$

    Here are some examples:
    wks50633:~John$
    iMac:~John$
    Brooke-PC:~John$
    localhost:~John$

    What is the name, and why does it change?
     
  2. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
    #2
    the hostname of the computer. It changes because a different DHCP server assigns it a different name.
     
  3. --- thread starter macrumors member

    Joined:
    Nov 1, 2008
    Location:
    Canada
    #3
    Thanks.
     
  4. --- thread starter macrumors member

    Joined:
    Nov 1, 2008
    Location:
    Canada
    #4
    wait, so the DHCP thing changed the hostname to teh-pwnerer ? Does it just have a big list of names to randomly assign to computers?
     
  5. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
    #5
    The DHCP gets the name from the DNS, which maintains the records of all the IPs and hostnames. The DHCP can also update DNS with a hostname on behalf of the client.

    The DNS would have a list of A records for assigning hostnames to IPs.
     

Share This Page