Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a local domain available on all computers on lan

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/

like image 720
Manoj Dhiman Avatar asked Apr 02 '15 12:04

Manoj Dhiman


2 Answers

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.

like image 157
Laszlo Valko Avatar answered Nov 07 '22 08:11

Laszlo Valko


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

like image 23
Jacob Avatar answered Nov 07 '22 08:11

Jacob