1

I wanted to change my ipv4 address (172.50.10.1) into somewhat like www.jamesrin.com when the clients within the LAN access my server on their respective browsers.

I've searched the browser. According to them, I can just change the hosts file of each of the client within the LAN for then to access my server, with this method. It just works fine.

But that's not what I want. What I want is for clients within the LAN to access my server without changing each clients hosts file using the example above, www.jamesrin.com.

Actually, im really stuck on where to begin with. Do I need to setup DNS server? Btw. I just want it offline mode. within the LAN only.

Do you have any ideas, suggestions? or somewhat tutorial regarding my problem. It would be much appreciated! Thank you!

closed as off-topic by Rui F Ribeiro, Jeff Schaller, mdpc, roaima, Archemar Feb 2 '18 at 15:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Rui F Ribeiro, mdpc, roaima
If this question can be reworded to fit the rules in the help center, please edit the question.

4

First so all, I strongly discourage you to use a "real" domain (like www.jamesrin.com) for that, even if your LAN is not connected to the internet. I would rather recommend using a domain like www.jamesrin.lan or www.jamesrin.test which is no valid TLD. (But do not use .local, that's reserved for mDNS).

So if you don't want to edit the hosts file of each client, you either could set up a DNS server or use mDNS. Whenever a .local domain is needed to be resolved using mDNS, a request is sent to any computer in your local network. And one computer replies to this with his IP.

If Avahi (a Zeroconf/mDNS implementation) is set on your clients (this is usually the case) you can just use a domain like hostname.local. If you query this domain, a request is sent using a broadcast and the computer with the hostname hostname responds with his IP. So just try changing the server's hostname to jamesrin and check whether you can reach jamesrin.local (without www.) from another computer.

The other option would be to set up a DNS server in your network. Usually there's a DNS server running on your router - maybe you can use that if you can manually add DNS records (or edit the router's hostfile). (But it isn't clear in your question whether you got a router as you write "offline").

Else you need to set up a DNS server on a computer. I would recommend having a look at this answer on SuperUser.

  • I think using mDNS and/or Link-Local Multicast Name Resololution (LLMNR) would be a better idea than setting up a DNS server for just for a single LAN. It could be enabled already on your Ubuntu machine, try pinging with host names (with and without the .local suffix). If they don't respond, start the the systemd-resolved service and try again. – Johan Myréen Feb 1 '18 at 13:31
  • 1
    On the contrary DO NOT use a made up TLD for your internal needs, as you risk collision. TLDs happen to be added, some something "not a valid TLD" can become one yesterday. You should instead register a domain name, and you can use a subdomain, like local.jamesrin.com or home.jamesrin.com or whatever to name all your local hosts, and handle that with an internal DNS server. – Patrick Mevzek Feb 3 '18 at 2:26

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