Results 1 to 4 of 4

Thread: Using short host names on a LAN

  1. #1
    Join Date
    Nov 2006
    Beans
    53

    Using short host names on a LAN

    I'm running Ubuntu 11.10

    I have a very small home network (partly wired, partly wireless) with fixed IP addresses.

    I want to be able to refer to each host by a short name.

    In the past I have done this by adding lines to /etc/resolv.conf, such as:

    vesta 198.162.0.2
    ceres 198.162.0.3

    But this does not work on my current system. What's more, when the machine is rebooted /etc/resolv.conf is overwritten with

    # Generated by NetworkManager
    nameserver 192.168.0.1

    What do I need to do to get the result I want?

  2. #2
    Join Date
    Dec 2007
    Location
    California
    Beans
    4,899
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Using short host names on a LAN

    try your hosts file at /etc/hosts
    "You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"

    "Don't let your mind wander -- it's too little to be let out alone."

  3. #3
    ahallubuntu is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Jul 2005
    Beans
    2,050

    Re: Using short host names on a LAN

    Quote Originally Posted by DavidS View Post
    I'm running Ubuntu 11.10

    I have a very small home network (partly wired, partly wireless) with fixed IP addresses.

    I want to be able to refer to each host by a short name.

    In the past I have done this by adding lines to /etc/resolv.conf, such as:

    vesta 198.162.0.2
    ceres 198.162.0.3

    But this does not work on my current system. What's more, when the machine is rebooted /etc/resolv.conf is overwritten with

    # Generated by NetworkManager
    nameserver 192.168.0.1

    What do I need to do to get the result I want?
    As was pointed out above, try using /etc/hosts instead of /etc/resolv.conf instead.

    If you want to make things much easier for yourself, put DD-WRT (Linux-based) firmware on your router, or get a router that is supported by DD-WRT. (Or Tomato or some other open source firmware.) Then instead of static IP, you can make DHCP reservations for each machine in the router itself (so IPs never change) and not have to set them on each machine. What's more, you can set the names in the router, too, and not have to put them on each individual machine's /etc/hosts file.

  4. #4
    Join Date
    Nov 2006
    Beans
    53

    Re: Using short host names on a LAN

    Thanks very much for your help - problem solved!

    I am using a Netgear DGN1000 router, which allows me to use some static IP addresses whilst using DHCP for additional hosts. But so far as I can tell I can't set the names.

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
  •