# Cannot access server when I'm not using my VPN

**URL:** https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959
**Category:** Support
**Tags:** english
**Created:** [October 9, 2018, 10:08pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959 "2018-10-09T22:08:09Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 9, 2018, 10:08pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/1 "2018-10-09T22:08:09Z")

</div>

As the title says, I can’t access my server unless my computer and server both are connected to my VPN. I noticed this when I was trying to install a Let’s Encrypt certificate for a domain and got Errno 22 “can’t access server through http”. I have this problem both with a noho.st subdomain and a domain name I own myself.

The debug message from the cert-install command tells me “domain IP from DNS” and “public IP from the server” are identical to each other, both when I’m on VPN and when I’m not. “domain IP from local DNS” on the other hand is different from both my VPN IP address and my normal IP address. It remains the same regardless of whether I’m connected to the VPN or not though.

Any ideas of what my problem could be? Hints of how to debug? What is a “local DNS” anyway?

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 11, 2018, 11:34pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/2 "2018-10-11T23:34:31Z")

</div>

Some new clues. Local DNS as I understand is for example when you have connected a particular IP to some domain name in `/etc/hosts` or in `/etc/resolv.conf`. In my .conf-file for OpenVPN there is an `up` and a `down` option that calls the script `/etc/openvpn/update-resolv-conf`. However, my resolv.conf is really simple, just this:

```auto
# Generated by resolvconf
nameserver 127.0.0.1

```

which doesn’t correspond to the local DNS IP iget from `yunohost domain cert-install`. (The one I get from there is always one owned by my VPN provider).

Does anyone else make use of the `update-resolv-conf` script? Has it caused trouble? I think it comes with the Debian version of OpenVPN.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [October 12, 2018, 12:42am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/3 "2018-10-12T00:42:06Z")

</div>

Have you configured your vpn by hand or did you use vpnclient app ?

When you don’t use your VPN, did you configure your router with a DMZ / upnp or port forwarding ?

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 12, 2018, 10:30am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/4 "2018-10-12T10:30:28Z")

</div>

I don’t use the vpnclient app. I just installed OpenVPN and followed the instructions from my VPN-provider. Basically putting their .conf-file in the right place and enabling the service `openvpn-client@conffile.service`.

I have UPnP activated and reloaded the firewall after I closed down the VPN but the local DNS IP didn’t change.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [October 12, 2018, 11:45am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/5 "2018-10-12T11:45:59Z")

</div>

Have you configured your router? it may not accept upnp protocol

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 12, 2018, 11:47am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/6 "2018-10-12T11:47:16Z")

</div>

Yes, I have activated UPnP in the router settings.

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 12, 2018, 11:53am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/7 "2018-10-12T11:53:29Z")

</div>

Do you think I should try the vpn-client app instead? I could do it if there’s any point to it. I noticed the [feature](https://github.com/labriqueinternet/vpnclient_ynh) “Set DNS resolvers on the host”. It sounds kind of related to my problem.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [October 12, 2018, 11:56am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/8 "2018-10-12T11:56:13Z")

</div>

No your problem is not related to the DNS resolver,

```auto
nameserver 127.0.0.1

```

This file is ok, because dnsmasq should be running and be used as a partial dns resolver.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [October 12, 2018, 12:01pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/9 "2018-10-12T12:01:22Z")

</div>

> As the title says, I can’t access my server unless my computer and server both are connected to my VPN.

How do you access to your server with the ip (and which ip) or with the domain name ?  
A computer outside on the internet can’t access to your server in that case ?  
Has your VPN a public ip ?

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [October 12, 2018, 12:03pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/10 "2018-10-12T12:03:00Z")

</div>

You should try by configuring a port forwarding or a DMZ on your router.

May be the router do hairpining  
[https://yunohost.org/#/isp\_box\_config](https://yunohost.org/#/isp_box_config)  
[https://yunohost.org/#/diagnostic](https://yunohost.org/#/diagnostic)

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 12, 2018, 1:31pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/11 "2018-10-12T13:31:26Z")

</div>

> [@ljf](#):
>
> How do you access to your server with the ip (and which ip) or with the domain name ?

I’m accessing it trough the domain name. Curiously enough, I can’t seem to access it with just the IP address now that I check. I have two domain names, one [nohost.me](http://nohost.me) address and one ordinary domain name. Both work when I’m connected to the VPN.

> [@ljf](#):
>
> A computer outside on the internet can’t access to your server in that case ?

Yes, that’s right. When I’m using my my computer on the same WiFi as the server but with VPN disconnected on the computer I can’t access it. I also can’t access it when using my mobile phone’s 4g internet.

> [@ljf](#):
>
> Has your VPN a public ip ?

This is interesting. I looked at their web page and it seems they have an additional service that I can subscribe to called “Public IPv4”. I don’t have it now. Does it mean they can block access to my server? They say that they don’t filter traffic in any way.

> [@ljf](#):
>
> You should try by configuring a port forwarding or a DMZ on your router.
> 
> May be the router do hairpining  
> [YunoHost • index](https://yunohost.org/#/isp_box_config)  
> [YunoHost • index](https://yunohost.org/#/diagnostic)

According to the first page, UPnP should be enough. I also don’t think that it’s hairpinning because I can’t access it from outside my home network either (tried it on my phone’s 4g).

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 12, 2018, 1:42pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/12 "2018-10-12T13:42:57Z")

</div>

I think I found the answer to the question about my VPN provider blocking the server. This is on their homepage:

> [@](#):
>
> #### Ports
> 
> All incoming ports for devices not utilizing the Public IPv4 add-on are closed for security reasons. If you need to open a port you can open one here.

And they won’t let me open ports below 49152. I guess that rules out using VPN unless I pay up (since I would need port 80 and 443 for http and https).

The problem still remains when I’m not using my VPN though. I shut down the VPN connection and reloaded the firewall. Still, it can’t be accessed. Trying to do a cert-install gives me the local DNS IP ` - domain ip from local DNS 127.0.0.1`, which is different from before.

I will give port forwarding a shot and see if it makes any difference.

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 12, 2018, 2:00pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/13 "2018-10-12T14:00:22Z")

</div>

Ok, I guess I have it figured out now. Using manual port forwarding actually solved it. I don’t understand why UPnP didn’t work despite being activated. Thanks, @lfj, for the advice 😁

---

<div class="post-metadata">

### Author: ![jimmiewilliams](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/j/df705f/32.png) [@jimmiewilliams](https://forum.yunohost.org/u/jimmiewilliams)
#### Post date: [October 18, 2018, 9:54am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/14 "2018-10-18T09:54:54Z")

</div>

You havent mentioned which VPN are you using? i think its a vpn issue due to which you cannot access to server.For LibreELEC. i am using surfshark vpn and its the best LibreELEC vpn so surfshark will solve your issue as well.

---

<div class="post-metadata">

### Author: ![Poyu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/poyu/32/1594_2.png) [@Poyu](https://forum.yunohost.org/u/Poyu)
#### Post date: [October 20, 2018, 1:20pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/15 "2018-10-20T13:20:58Z")

</div>

Yes, it was my VPN. They were blocking all incoming ports. Solved by buying an additional service from them which allows me to use ports.

---

<div class="post-metadata">

### Author: ![nick45](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nick45/32/1633_2.png) [@nick45](https://forum.yunohost.org/u/nick45)
#### Post date: [October 22, 2018, 7:35am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/16 "2018-10-22T07:35:01Z")

</div>

It’s surprising that a VPN is blocking a host server. I have been using PureVPN and its different VPN Servers, and I didn’t face any issue like this yet none of my server conflict with each other.

---

<div class="post-metadata">

### Author: ![Lindaawilsoon](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/l/3da27b/32.png) [@Lindaawilsoon](https://forum.yunohost.org/u/Lindaawilsoon)
#### Post date: [February 7, 2019, 7:02am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/17 "2019-02-07T07:02:34Z")

</div>

Hi Poyu,  
i was in trouble like you but in a mean time i rectify the issue, i had a free VPN for China and the same issue was created, Paid VPNs gives better service instead of Free. if you have paid VPN service then no Problems like this one.

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [February 19, 2019, 7:24pm UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/19 "2019-02-19T19:24:01Z")

</div>

@alicejosef, third post created, third about the same website.  
Next time, you’re banned…

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [December 9, 2019, 11:32am UTC](https://forum.yunohost.org/t/cannot-access-server-when-im-not-using-my-vpn/5959/21 "2019-12-09T11:32:07Z")

</div>


