2

I'm using Ubuntu server in my local network. I access the hosted sites on it from other computers using the local ip address. for example: 192.168.100.2/info.php/. I want to set a domain name to use it in the local network so i can access the sites like this: domain.dev/info.php/.

  • 1
    It depends, where do you, and the "other computers" get their address resolution from? Look at /etc/resolv.conf (on each),man 3 resolver, man 5 resolv.conf and man 8 resolvconf. Or, you could cheat, and add 192,168.100.2 server server.localdomain to all the /etc/hosts – waltinator Sep 10 '15 at 2:59
1

if you are doing this in organization where you want to access this url anywhere in private network then configure DNS.

if you just doing in local system and want to access from a specific hosts then you can do this by /etc/hosts file

open /etc/hosts file using

sudo gedit /etc/hosts

then do entries like

192.168.100.2  domain.dev  hostname 

also mention ip and FQDN on all system's /etc/hosts where you want to access . so , all system know each other.

  • So what you're saying is, adding the domain to hosts file won't let me access that domain from other devices on the network? Then how do i do it? You mentioned configuring DNS. How do I do that? – onlyforthis May 6 '16 at 14:55
0

I simply had to do the DNS configuration on my router and then I was able to access the domain from all devices on the network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.