I am trying to make my Ubuntu Server (16.04) run behind a VPN. I have a subscription to NordVPN and have followed their procedure to connect to the VPN via OpenVPN - it successfully connects.

I then use Screen to continue running OpenVPN in the background, and when I try to check the servers external IP or ping google.com it fails as if there is no connection to the VPN. I have tried multiple VPN servers. What am I doing wrong?

EDIT: ifconfig

enp2s0    Link encap:Ethernet  HWaddr a0:b3:cc:df:31:91
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::a2b3:ccff:fedf:3191/64 Scope:Link
          RX packets:2190765 errors:0 dropped:16 overruns:0 frame:0
          TX packets:2347458 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2100301066 (2.1 GB)  TX bytes:1710956391 (1.7 GB)

> lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:132225 errors:0 dropped:0 overruns:0 frame:0
          TX packets:132225 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:37777958 (37.7 MB)  TX bytes:37777958 (37.7 MB)

> tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:  P-t-P:  Mask:
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:598 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:21997 (21.9 KB)  TX bytes:62173 (62.1 KB)

Tried to ping google.com - failed to get a response.

downloading a file with wget get:

wget: unable to resolve host address


PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=48 time=404 ms
64 bytes from icmp_seq=2 ttl=48 time=370 ms
64 bytes from icmp_seq=3 ttl=48 time=369 ms
64 bytes from icmp_seq=4 ttl=48 time=369 ms
64 bytes from icmp_seq=5 ttl=48 time=404 ms
64 bytes from icmp_seq=6 ttl=48 time=369 ms
--- ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 369.680/381.456/404.838/16.344 ms

EDIT 2: dig a google.com @

; <<>> DiG 9.10.3-P4-Ubuntu <<>> a google.com @
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15859
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;google.com.            IN      A

google.com.         203     IN      A

;; Query time: 388 msec
;; WHEN: Wed Aug 31 15:00:37 AEST 2016
;; MSG SIZE  rcvd: 55
  • For assistance, you will need to provide your network configuration and actual tests. Does ping get replies? If not, show us your routing table (route -n) while connected. – Julie Pelletier Aug 31 '16 at 4:15
  • @JuliePelletier Thanks for the response. I have added ifconfig, wget and the ping – Shady Ady Aug 31 '16 at 4:26
  • Can you show the output of dig a google.com @ – Julie Pelletier Aug 31 '16 at 4:57
  • By the way, as you can see, multi-line quotes don't show line feeds so you should show them as code. – Julie Pelletier Aug 31 '16 at 5:04
  • @JuliePelletier put settings in code blocks and added the dig a google.com – Shady Ady Aug 31 '16 at 5:10

All you need to do to get everything working is to set up your local DNS settings properly.

The simplest way to do it is to put nameserver in /etc/resolv.conf after backing it up (mv /etc/resolv.conf /etc/resolv.conf.bak).

  • Thanks so much for your help. If you don't mind, why did that work setting the DNS to Googles? What did the "dig a google.com @" tell you. – Shady Ady Aug 31 '16 at 5:23
  • It was actually already obvious when you were able to ping that you could use it for your DNS but I wanted to make sure there was nothing blocking it. dig is a DNS query tool. – Julie Pelletier Aug 31 '16 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.