How to change Ubuntu server domain name?
Solution 1
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.
Solution 2
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.
Related videos on Youtube
onlyforthis
Updated on September 18, 2022Comments
-
onlyforthis over 1 year
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/.
-
goo over 8 yearsIt 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
andman 8 resolvconf
. Or, you could cheat, and add192,168.100.2 server server.localdomain
to all the/etc/hosts
-
-
onlyforthis about 8 yearsSo 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?