jm85
Posts: 2
Joined: Thu Oct 11, 2018 2:12 pm

url redirect to ip

Thu Oct 11, 2018 2:17 pm

I apologise if this has been answered somewhere else. I’m a noob, so I just don’t have the vocabulary to find the solutions which I know for sure are out there.

I have a rpi3 with yunohost installed. I do _not_ want to make this internet-facing via port forwarding – just local access. I can connect to it via the IP from the rpi3 itself. So 192.168.1.99/nextcloud on the browser takes me to the yunohost nextcloud login. But yunohost is setup to be accessed via a url, something like myserver.local, so I can’t connect to it from any other device on the local network using the IP address.

The yunohost site recommends going into the router and configuring a DNS redirect, which would redirect http://myserver.local to the IP of the yunohost server. But my router doesn’t have this option.

So I wanted to know, can I use a rpi to redirect all local requests of http://myserver.local/nextcloud to 192.168.1.99/nextcloud? Can I do this with the same rpi3 yunohost is installed on, or do I need another device?

Or should I be looking at a completely different solution?

Thanks for reading.

scotty101
Posts: 3649
Joined: Fri Jun 08, 2012 6:03 pm

Re: url redirect to ip

Thu Oct 11, 2018 2:35 pm

You can host a DNS (Domain Name Server) on a Raspberry Pi.

You would need to change your router settings so that all devices on the network use that Pi as their "first port of call" when it comes to resolving URL to IP addresses.

Top results from google for "raspberry pi domain name server"
https://www.1and1.co.uk/digitalguide/se ... ns-server/
https://www.pcworld.com/article/3200117 ... smasq.html
https://www.raspberrypi.org/learning/ne ... on-4/plan/
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

jm85
Posts: 2
Joined: Thu Oct 11, 2018 2:12 pm

Re: url redirect to ip

Fri Oct 12, 2018 11:01 am

Thanks, will try this.

Will this slow down browsing experience for users on the network in any way?

sora03
Posts: 193
Joined: Mon Dec 29, 2014 4:11 pm
Contact: Website

Re: url redirect to ip

Fri Oct 12, 2018 1:21 pm

jm85 wrote:
Fri Oct 12, 2018 11:01 am
Thanks, will try this.

Will this slow down browsing experience for users on the network in any way?
You may also want to try Pi-hole, it is a DNS level ad-blocking system, it requires you to make the Pi as the DNS server so you can set the IP address as hostname for local network. If the Pi is powered down then the DNS will not work, you can add a secondary fallback DNS server in your router to fix this.
FLOSS enthusiast, Debian user (linux-libre)

Return to “Networking and servers”