Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 have a raspberry pi which who's host name is greenbean3 and it has a static IP of 10.120.11.30 and it is running nginx. I can access it via a web browser using http://10.120.11.30/. I installed avahi-daemon and I can ping it from a local device (yet for some reason not all local devices). Nginx is set up using server_name $domain_name greenbean3 greenbean3.local;.
My desire is to access it via a local web browser using http://greenbean3.local/ or http://greenbean3/ instead of the IP, but cannot do so and get greenbean3.local’s server DNS address could not be found. error. What can I do? Thank you
Code:
michael@raspberrypi2:/var/www $ ping greenbean3.local
PING greenbean3.local (10.120.11.30) 56(84) bytes of data.
64 bytes from 10.120.11.30: icmp_seq=1 ttl=64 time=0.339 ms
64 bytes from 10.120.11.30: icmp_seq=2 ttl=64 time=0.348 ms
^C
--- greenbean3.local ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.339/0.343/0.348/0.019 ms
michael@raspberrypi2:/var/www $
Thanks Habitual, While I appreciate such a simple fix, this has one issue which I am a little concerned to tell you what it is as I am sure I will be damned for doing something so foolish and irresponsible. The who purpose of the web server is to change the network configuration settings, and I am using script to edit /etc/dhcpcd.conf and then restart the network. If I use this poor man's DNS approach, I need to parse even more config files.
avahi is providing the local DNS service but AFAIK needs to be running on all linux boxes. MACs use bonjour and you would have to install it on Windows. For all devices connected to the local LAN to resolve hostnames to IP address you would need a local DNS server i.e. dnsmasq or bind. dnsmasq is simpler to configure is also a dhcp server and you can use an include file.
Considering that webmin and cups change configuration files but are standalone applications and not Nginx or Apache which have limitations on directories/permissions.
I would rethink what I'm trying to do. People shouldn't be able to arbitrarily change their ip, especially not on a network outside of their home. Otherwise you can end up with collisions. The right way to do this is a dns server ( i use bind 9 at home) and a dhcp server with ip addresses assigned via mac address I would think.
What is the end goal and what are you trying to achieve by giving people the ability to change their static ip?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.