Virtualmin with external DNS Manager

| SYSTEM INFORMATION |
|------------------------------|-------------------------------|
| OS type and version | Debian Linux 10 |
| Virtualmin version | 7.7 |

Hi Virtualmin Community.
I’m sharing my issue with you in the hopes of finding a solution. I’m currently using Virtualmin on a VPS to manage my web applications, and I have an external DNS manager where all records point to this server, allowing me to access my web apps. One of my applications is WordPress, and when I checked the “Site Health Status,” I noticed two critical issues:

– The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.

When testing the REST API, an error was encountered:

REST API Endpoint: https://mydomain.com/wp-json/wp/v2/types/post?context=edit
REST API Response: (http_request_failed) cURL error 6: Could not resolve host: mydomain.com

– Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.
Error: cURL error 6: Could not resolve host: mydomain.com (http_request_failed)

I conducted some research to find a solution and discovered some indications that these issues may be related to DNS.

I’m wondering how to instruct Virtualmin to utilize the external DNS Manager instead of the local one.
Or if this is not the reason please guide me.

Dns is not the issue. If you can access the site. Most likely a plugin conflict

If this is one but all the other “applications” can be accessed the just as @jimr1 has indicated it is NOT a DNS problem. Once again it is WordPress (or more specifically that plugin).

@Stegan, @jimr1 thanks for the reply.
Initially, I have basic PHP applications that do not involve any API calls, so there are no issues with them, except for WordPress.
Additionally, I had a suspicion that one of the plugins might be the root cause. To investigate this, I installed a fresh WordPress instance on a subdomain, and the same issues persisted, even though no plugins were installed.

Forget WP for a moment.
I assume you have a domain name.
put a index.html (“Hello world”) in the public_html of the VS.
If you can see it then there is no DNS problem.

Or use a tool like DNS Checker

Also I thought WP was designed to run on a domain (not a “subdomain”)

I ‘think’ based on your question is you want to provide external name servers in your /etc/resolv.conf file.

it@~:cat /etc/resolv.conf 
# Generated by NetworkManager
nameserver 208.67.222.222
nameserver 208.67.220.220
it@~:
1 Like

Indeed, I attempted to do this manually before by adding “8.8.8.8” and “8.8.4.4,” but I temporarily lost access to the server, and the previous configuration was automatically restored.

I agree with your assessment that there doesn’t seem to be any DNS issue.
However, I suspect that Virtualmin is using its own DNS manager, and this may be the reason why WordPress is unable to resolve the domain.

This makes no sense. If the external DNS is correct that file should make no difference. I’m guessing you rebooted and you dynamic settings refreshed these settings?

What IP is getting installed? If you are on a provider network it is generally their name servers that get populated into resolv.conf.

And Virtualmin doesn’t use its’ own DNS manager. That is a system configuration which it would only manage as far as I know. On both of my remote instances the provider DNS is loaded automatically into my /etc/resolve.conf file.

1 Like

It doesn’t matter who is providing the DNS records as long as they point to the correct box (VS) if the A and (AAAA) records do not point to your IP then your VS will be blind to the internet. You would not be able to get a SSL cert from Lets Encrypt and without the corresponding MX record, no email.

Everything else is downstream, ie WP its setup and its plugins/themes.

You could try putting the domain in your /etc/hosts file.

1 Like

So who are your name servers ? If you are using your providers nameservers what ever you add there will be your dns records use something like mxtoolbox to see exactly what dns records and name servers you are using

1 Like

I have no idea what you’re asking. What is a DNS Manager?

1 Like

I am guessing this is the panel at the OP’s registrar to add/edit dns records and or nameservers. That said curl error 6 is a broadish error as it applies to both resolution & ssl cert errors
@layfateh if you are using https swap back to http and see if it works then, this will rule out any ssl problems, I have reproduced your error on a test system (not wordpress) but using php curl the same as wordpress does nd my error was down to a bad cert.

1 Like

@jimr1, @ID10T, Stegan, Joe;

Upon reviewing your insightful responses, I made changes to the host file by adding the domain.

# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
#
127.0.1.1 server.mydomain.com server
127.0.0.1 localhost
127.0.0.1 mydomain.com // Added line

I observed that the initial issues disappeared, but new problems related to SSL emerged.

Subsequently, I reverted the changes I made to the host file and turned my attention to the resolve.conf file, where I inserted the IP address of the Nameserver.

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
nameserver ns1.providerdomain.com // Added line

This resulted in the previous issues being resolved, but new issues surfaced, as follows:

The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.

When testing the REST API, an error was encountered:

REST API Endpoint: https://anpp.dz/wp-json/wp/v2/types/post?context=edit
REST API Response: (http_request_failed) cURL error 28: Resolving timed out after 10000 milliseconds
Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.
Error: cURL error 28: Resolving timed out after 10000 milliseconds (http_request_failed)

This could be wrong if you have external dns unless you also have bind working on your machine.

If your rest api relies on an internal DNS then that sounds wrong.

If you edited the /etc/resolv.conf by hand you may want to go to this page and make the changes so they stick on reboot. Not sure if you have them configured static or not.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.