Bobcares

“Cannot resolve host address” in OpenVPN – Here’s how to fix it

by | Feb 19, 2019

OpeVPN is a great tool to implement secure point to point connections.

But, often a single wrong step during the setup can break the connection and result in errors.

One such error in OpenVPN is “cannot resolve host address“.

At Bobcares, we help users resolve OpenVPN connection errors as part of our Managed VPN services.

Today, we’ll discuss the top 4 reasons for the error cannot resolve host address in OpenVPN and how we fix them.

 

Cannot resolve host address in OpenVPN – What this means?

Customers usually face this error when trying to make an OpenVPN connection. This error means that the DNS servers refused to resolve the hostname. Here, our Support Engineers check the server logs and detailed error looks like this:

2019-01-21 20:19:01 MANAGEMENT: >STATE:1489260308,RESOLVE,,,
2019-01-21 20:19:01 RESOLVE: Cannot resolve host address: vpn.xx.xx.xx.xx.com: nodename nor servname provided, or not known

 

Cannot resolve host address in OpenVPN – Causes & Fixes

Now, let’s see the main reasons for this error and how our Dedicated Engineers fix them.

1) Firewall restrictions

One of the common reasons for this error is customer’s local firewall blocking the connection to the OpenVPN server. Additionally, firewall rules can block the DNS connections on the system. Similarly, the Antivirus program installed on the customer’s system can also hamper the VPN functionality.

So, in such cases our Support Experts temporary disable the security applications and the Antivirus program one by one. Thus, we can determine which application is blocking the connections and fix it’s settings.

Moreover, we ensure to allow the following in firewall.

  • Loop backup interface or hostname itself.
  • Interface created by OpenVPN.
  • UDP packets on port 53 for DNS queries.

 

In addition to that, we ensure that the ports required for the OpenVPN to communicate are included in the router settings.

 

2) Incorrect hostname

Similarly, a typo in the hostname or an inactive host specified in the OpenVPN settings can lead to this error.

Firstly, our Support Experts confirm whether the host is active using the ping command.

ping vpn.xx.xx.xx.xx.com

 

In addition to that, we check the DNS connectivity of the hostname using dig and nslookup commands.

dig vpn.xx.xx.xx.xx.com
nslookup vpn.xx.xx.xx.xx.com

 

In this way, we confirm that whether the customer uses a valid and correct hostname.

If we find any problems with the hostname, we’ll contact the customer and update them to use the correct hostname. Alternatively, we update the customer to use the explicit IP address instead of the domain name.

3) DNS servers

If that doesn’t work, this error can be caused by the DNS settings.

Sometimes, DNS servers doesn’t resolve the server name translating it to the IP address. This can be due to DNS spoofing in some countries that censor websites.  In other words, the DNS servers in these countries refuse to resolve the hostname or provide the wrong IP address leading to a dead link.

Our Support Experts easily fix this by helping the customer to switch the DNS servers on their computer to the ones outside the country. There are many free DNS servers available such as Google, OpenDNS, etc.

Google DNS : 8.8.8.8 and 8.8.4.4
OpenDNS server 208.67.222.222 and 208.67.220.220

 

For example on a Mac system, we modify the DNS servers from System Preferences > Network > Select the connections through which you connect > Advanced > DNS > DNS servers > Update the new DNS servers > OK > Apply.

Most importantly, we update the customers to change the network adapter settings as well.

 

4) OpenVPN client configuration

Similarly, this error can also be caused by misconfigured OpenVPN client configuration. A sample OpenVPN configuration looks like this.

client
dev tun
proto tcp
remote vpn.xx.xx.xx.xx.com 1194 
resolv-retry infinite 
remote-cert-tls server 
nobind 
persist-key 
persist-tun
verb 3
pkcs12 D:\\{cert}.p12

 

A single wrong entry in this file can affect the working of the VPN service. In such cases, our Server Experts get the OpenVPN client configuration and correct the wrong entries to fix the issue. Sometimes, we need to switch the protocol from TCP to UDP in the configuration to fix the issue.

 

4) Incorrect host file entry

Also, incorrect entries in the /etc/hosts file of your system may result in this error. Ideally, the localhost entry should be in the /etc/hosts file of your system, so that localhost name can be resolved. Missing localhost entry or typo mistakes in this file will create problems.

Here, our Support Engineers get the /etc/hosts entry details from the customers and make sure that the first entry is given as below.

127.0.0.1 localhost

 

[And do you need a server expert to resolve your OpenVPN errors. Our Experienced System Experts can help you here.]

 

Conclusion

In short, “cannot resolve host address” error in OpenVPN can occur due to firewall restrictions, OpenVPN client configuration errors, and so on. Today, we’ve discussed the top 4 reasons for this error and how our Support Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF