Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Hostname for server

  1. #1
    Join Date
    Mar 2005
    Location
    Ice cold Norway
    Beans
    517

    Hostname for server

    Hi, I have a second computer I use as a file server at home. I have installed Ubuntu and Samba on it and I can reach it from Places > Connect to server and selecting Windows share.

    The thing is I want it to be known as its name and not the ip. I did add a line in /etc/hosts like this "10.0.0.3 kafka" (it's called kafka). The router is configured so to give the server that ip each time.

    Still it shows up as the ip when I connect. How do I correct this?

  2. #2
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hostname for server

    What do you mean "it shows up as the IP"? Where?
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Sep 2007
    Location
    Masschusetts
    Beans
    1,510
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Hostname for server

    Quote Originally Posted by graabein View Post
    Hi, I have a second computer I use as a file server at home. I have installed Ubuntu and Samba on it and I can reach it from Places > Connect to server and selecting Windows share.

    The thing is I want it to be known as its name and not the ip. I did add a line in /etc/hosts like this "10.0.0.3 kafka" (it's called kafka). The router is configured so to give the server that ip each time.

    Still it shows up as the ip when I connect. How do I correct this?
    Code:
    10.0.0.3 kafka
    should have a tab not a space

    Code:
    10.0.0.3     kafka
    Registered Linux User: 482377
    MacBook (1,1) - OS X Leopard
    ASUS P5LD2 - Core 2 Duo 3.0GHz - 2GB Corsair RAM - Nvidia 8800GT - Ubuntu 9.04 / Windows 7 Professional

  4. #4
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hostname for server

    Quote Originally Posted by DGortze380 View Post
    Code:
    10.0.0.3 kafka
    should have a tab not a space

    Code:
    10.0.0.3     kafka
    Wrong. Both work equally fine.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Mar 2005
    Location
    Ice cold Norway
    Beans
    517

    Re: Hostname for server

    Quote Originally Posted by HymnToLife View Post
    What do you mean "it shows up as the IP"? Where?
    On the desktop it shows up as 10.0.0.3 and when I try to do "ssh kafka" it don't get it, but "ssh 10.0.0.3" works fine.

    I'm on the latest Ubuntu with GNOME btw.
    Last edited by graabein; June 26th, 2009 at 07:33 AM.

  6. #6
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Hostname for server

    You also have to enter

    10.0.0.3 kafka
    In the /etc/host file of every computer you want to connect to the server.

  7. #7
    Join Date
    Mar 2005
    Location
    Ice cold Norway
    Beans
    517

    Re: Hostname for server

    Quote Originally Posted by cariboo907 View Post
    You also have to enter

    10.0.0.3 kafka

    In the /etc/host file of every computer you want to connect to the server.
    There's only this one computer that's running Linux connected to the server. Can't remember if I saw a /etc/host file on it?

  8. #8
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Hostname for server

    Quote Originally Posted by cariboo907 View Post
    ... /etc/host file
    I presume you meant /etc/hosts.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad] [Sub-forum]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  9. #9
    Join Date
    Jun 2009
    Beans
    100

    Re: Hostname for server

    Wouldn't that require a DNS server? Then you'd add the DNS entry. I don't think the server's hostname would just resolve without a DNS server...

    -Kirk

  10. #10
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Hostname for server

    A DNS server is a more elegant solution, but for a small network, adding address/hostname pairs to each machine will work. (It'd work for a large network, too - just becomes cumbersome). It becomes a problem when DHCP is involved - the address/hostname pairs aren't constant.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad] [Sub-forum]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •