Access server from LAN is broken

I was running NC pretty much stable since version 13.2 (if I remember it right). Just a few days ago I gave upgraded to 15.3 and then in couple days there was a suggestion to upgrade to stable 16.xx Also I gave upgraded my ubuntu 18.4 as I do from time to time. Then I have rebooted my ISP router and I have to update my DNS record with my current IP and I wnt sleep. Next day I have used NC with a mobile app and on the same evening when I;m at home spotted that my NC not accessible. I have started do some investigation, some config changing and other stuff, but nothing that I THINK it could be dangerous. Then I spotted that NC works but from the external network only. My server in same LAN as my home network.
So the situation at the moment
Not possible to reach the server:

  • from my laptop and desktop PC any browser browsers
  • from Windows and Linux clients
  • from mobile app when on local LAN WiFi
  • from mobile browsers when on local LAN WiFi (but one yes, will list it below)

But it’s possible to access my server if:

  • from mobile Opera browser when on local LAN WiFi ! So strange…
  • from mobile all browsers and mobile app when on cell mobile network.

I have seen other forum topics that people have problems to reach server when on the same LAN but I did have no problems for nearly a year. Also, I’ve found one topic that Fail2Ban was interrupting local IPS, but I have no Fail2Ban on my server and my system quite simple.

I can access apache2 default web page when entering the local IP address of the server to web browser, but cant reach NC when entering nextcloud.mydomain.com. But I’m redirected from http:// to https:// as per my Apache2 site config.

My system at the moment Ubuntu 18.04.2
NC 16.0.3
Apache 2.4
php 7.2

Not sure how to sort it out without an internal DNS server.
Thank you for any reply.

It sounds like you have a DNS issue. I would start there. Run:

nslookup nextcloud.mydomain.com

Do this on your WiFi and off-site and verify the IP address is correct.

Thanks for reply.
No that’s something else. I just maybe didn’t described myself clear enough. Everything else not related to my NC server and DNS is working just fine. As I said, I have no problems accessing my NC from outside with any other public IP, but not from my LAN IP. Only when with my mobile phone on Opera browser and in local LAN WiFi I can successfully access NC. Bit strange as I can’t do this with any other browser or device or NC client to do so.
BTW nslookup returns with good results, I mean it spits my routers public address, as otherwise I couldn’t access my NC from outside.

I think that’s your problem though. Normally you would use split horizon DNS so that on your LAN the DNS name gives you the local IP.

This is easy enough to test. If you put it in your hosts file with the local IP while on your LAN, does it work then?

I’m not sure what to tell you about Opera, whether the page is cached or something else weird is going on. I would just set that aside for the moment.

1 Like

You are right. It worked just fine after I updated hosts file on my Windows laptop. I did know that but haven’t tried myself, as I was sure that this won’t help. It worked but not sorting my problem.
I don’t want this :frowning: . For mobile phones, this not really good and for laptop too if I will take it away.

What this split horizon is? I need to research. And will it help me to sort my issue? Until I sort this I cant mark your reply as answer KarlF12 :slight_smile:

Sure, you will want to do some reading on the subject, but I can give you a quick rundown.

What this means is that you have a DNS server on your local network that you use while in your network. When you query this server for your Nextcloud, you set it up to respond with the local IP of the server, whereas in public DNS you would get the public IP.

The end result of this is that nextcloud.mydomain.com goes to the LAN IP while on your LAN, and goes to the public IP when not on your LAN.

If you try to access using the NATed public IP while on the same network as the server, normally this would not work. What strikes me as odd was that it was working before.

1 Like