Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I run website in linux & access it in lan via its ip address.
What configurations should i do in my linux system so that other users which are present in lan can access the website though their computer via a name not by my lan ip?
You need to precise if you have private IP address or public. And if you are administrator of this LAN. If private you need to create your own DNS server in LAN (the best if it will work all time), for example "dnsmasq" is good, simple tool for this. And configure clients to use it (if you can not administer this LAN configuration, than you must talk with somone who can). If public you can register your ip address on public DNS servers, but it usually cost some money per year.
If your LAN is really small, it may be easier to edit /etc/hosts files on each PC (in *nix-like OS), to point computers to some concret IP address. Windows also has the hosts file, but I'm not sure where it is located.
Code:
lexus@lexus:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 lexus
10.15.22.3 webserver
# 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
If your LAN is really small, it may be easier to edit /etc/hosts files on each PC (in *nix-like OS), to point computers to some concret IP address. Windows also has the hosts file, but I'm not sure where it is located.
Code:
lexus@lexus:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 lexus
10.15.22.3 webserver
# 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
So i have to change the host file in every computer. Is there any other way to just configure at single place ?
Quote:
Originally Posted by Ghostwheel
DNS is not just for the public internet. It is also for intranets. Check whether your router will allow your DHCP server to do DNS registrations.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.