11

I have 10 computers and i want to fetch my local host on all the systems . I am using ubuntu 12.04 . I changed my hosts file like this

127.0.0.1   localhost
127.0.1.1   ri8-MS-7788
192.168.1.22    manojdhiman.com

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

my projects are available on other computers with ip address if i hit url like http://192.168.1.22/ but not available if i use http://manojdhiman.com/

Manoj Dhiman
  • 5,096
  • 6
  • 29
  • 68

3 Answers3

8

There are two basic ways to achieve what you want:

  • populate and maintain (synchronize) /etc/hosts (or Windows equivalent) files on all your computers,

  • maintain a local DNS server, and configure all your computers (either directly or via DHCP) to use that DNS server.

Depending on the rate of changes (once per year or several times per day), it may or may not be sensible to automate the synchronization of the hosts files. The DNS server automatically solves the synchronization issue.

Laszlo Valko
  • 2,683
  • 25
  • 29
1

In order for this to work, you would need to add line 3 to the host file on ALL systems on your network.

Jacob
  • 890
  • 6
  • 16
0

my projects are available on other computers with ip address if i hit url like http://192.168.1.22/ but not available if i use http://manojdhiman.com/

If you just want to like that, you can change the DNS of your client. If your client is Windows OS, you can change the Alternate DNS Server to 192.168.1.22, please read this for more detail and if your client is Linux OS you can add/change /etc/resolv.conf to :

nameserver 192.168.1.22

Please read this how to change DNS in Linux.

If you want to more flexible to change that DNS, you can change your DHCP Configurations to add your IP Address to the DNS, so the computer can get it via DHCP instead you change it manually at one by one client computers.

Hope this will help you out. :)

Eko Junaidi Salam
  • 1,663
  • 1
  • 18
  • 26