Connect by local domain name on android

I have setup NC on the vps. I want to connect to it only through vpn tunnel (wireguard). I have configured vpn and find out reading the docs that I can’t use NC without domain name and ssl cert.
In my case this restriction don’t makes my life easier, but ok. I managed that, I got ssl cert, I wrote nc.myhost.local to the /etc/hosts on my laptop, boom, it works.
Now I want to make it works on my android phone. I have installed wireguard, made vpn works, install nextcloud app…
And realized I can’t change /etc/hosts on android without root access. My phone isn’t rooted.
Any suggestions?

Ps. I tried to use IP and one time it even worked! Ive been able to wrote my login/password, but finally I got error dns name isn’t resolved

This isn’t strictly speaking true, but it is a requirement or strongly encouraged by some installation methods.

In any case, with Wireguard on Android you have two choices:

  • in the VPN profile you can direct your client to use your internal DNS servers (i.e. the ones on the other side of the VPN - this could even include just the simple DNS server built into many consumer routers as along as you can configure a static record entry on it)
  • you can use a public DNS entry that points at a private IP address. Add a DNS entry for your Nextcloud Server’s private IP address to your chosen domain’s public DNS.

P.S. Don’t use .local if you’re sticking with private DNS (the first approach). It’s used for mDNS and many resolvers will randomly break. You’ll have mysterious problems. Use something like *.internal or, where appropriate, even a real hostname pointed at a private IP (as in the second approach).

1 Like

Thanks for answer! Can you please specify what installation method don’t require domain name?
In that case, will it works on android with IP only?

Well, a standard Archive based installation doesn’t. I believe for AIO Docker it would be required AFAIK. Not sure about the Snap offhand. Micro-services Docker doesn’t care.

There are other variables like proxies.

The main relevant config parameter within Nextcloud itself is trusted_domains: Configuration Parameters — Nextcloud latest Administration Manual latest documentation

1 Like