Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, How can i use names instead of IP-s in a local network? For example : instead http://192.168.1.34 i want to use something like: http://somename I have Centos 5.1 with ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    3

    DNS for local network

    Hello,
    How can i use names instead of IP-s in a local network?
    For example :
    instead http://192.168.1.34
    i want to use something like:
    http://somename
    I have Centos 5.1 with Apache on the server and the others are using Windows xp.

    Thank you.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    In general, you are asking what options do you have for "name resolution" on your network.

    There are several ways an OS may try to resolve names - some are the same across different OS's, and some are only available (natively) on a certain OS.

    Since your network is a mix of (at least) Windows and Linux, I would suggest either hosts entries or a DNS server.

    1. You can manually edit the hosts file (/etc/hosts = Linux, C:/Windows/System32/drivers/etc/hosts = Windows) with the IP to name pair for any machines you need resolution on. IE, you can add to all of the Windows machines' hosts - 192.168.10.37 centos-server - if you just need the XP machines to be able to resolve the Apache machine. Downside: If the Apache IP changes, you're editing all of those hosts files again to update them.

    2. DNS Server: You set up a DNS server with an entry for the Apache machine and it's IP, then point all of your machines to query the DNS server. More steps to set up, but if the IP changes, you only have to update it in one place - on the DNS server.

    HTH.

  3. #3
    Just Joined!
    Join Date
    Jan 2008
    Posts
    3
    I think the second option is the one i want to try. Unfortunately i have no ideea about how to modify the etc\hosts file. An example would help a lot.
    Thanks!

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Google > "modify hosts example" > Lots of Links

    Order of difficulty: Easy = Modify Hosts, Harder = Build DNS Server

    Which to choose? Answer: Depends on scale. If you have only a few machines to manually modify the hosts, go with that.

    * Edit: And did you *look* at the hosts file on XP? It has directions in it:

    Code:
    # Copyright (c) 1993-1999 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    127.0.0.1       localhost

  5. #5
    Just Joined!
    Join Date
    Jan 2008
    Posts
    3
    Thanks,
    I'll try to find more info on the name server method.

Posting Permissions

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