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/.
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 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.
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.