Skip to content

how to configure DNS records virtualmin?

Solved Linux
26 2 9.9k 1
  • wrote on last edited by
    #1

    hello sir, i have installed Virtualmin on a new digital ocean droplet as far i know everything is working fine but i could not point server to my subdomain

    here are my CF settings

    e6afb3d1-84bc-4d82-a989-0c9a045320e4-image.png

    i am not sure what i am missing. i have sent my Virtualmin DNS records over PM please tell me how to configure them correctly

  • wrote on last edited by
    #26

    i think we can mark this discussion as solved

    • learned how to install virtualmin with NGINX
    • We can easily point the DNS by mentioning server IP at CF a name record
    • learned how to install SSL
  • hello sir, i have installed Virtualmin on a new digital ocean droplet as far i know everything is working fine but i could not point server to my subdomain

    here are my CF settings

    e6afb3d1-84bc-4d82-a989-0c9a045320e4-image.png

    i am not sure what i am missing. i have sent my Virtualmin DNS records over PM please tell me how to configure them correctly

    wrote on last edited by phenomlab
    #2

    @hari have you set the subdomain or root domain yet in VirtualMin? You shouldn’t rely on DNS in VirtualMin as this has no bearing apart from which route to take internally as soon as the traffic arrives at the server itself.

    DNS zones on the VirtualMin server are automatically populated and you shouldn’t need to do anything there.

    I get this when attempting to access the link you sent in PM

    Screenshot_20220126-215838.jpg

  • @hari have you set the subdomain or root domain yet in VirtualMin? You shouldn’t rely on DNS in VirtualMin as this has no bearing apart from which route to take internally as soon as the traffic arrives at the server itself.

    DNS zones on the VirtualMin server are automatically populated and you shouldn’t need to do anything there.

    I get this when attempting to access the link you sent in PM

    Screenshot_20220126-215838.jpg

    wrote on last edited by Hari
    #3

    @phenomlab said in how to configure DNS records virtualmin?:

    have you set the subdomain or root domain yet in VirtualMin?

    i have used subdomain

    just now i have tried to install the certificate for the subdomain following this but let’s encrypt is not give the certificate

    https://www.ssldragon.com/blog/install-an-ssl-certificate-on-virtualmin/

    in log it looks like i have not configured the DNS correctly

    Domain: ask3.domain.com
      Type:   unauthorized
      Detail: Invalid response from
      https://ask3.domain.com/.well-known/acme-challenge/WCSL3V7RqeaQd41WBlLDBPK19uaY0ODLDTtRWJqSU68
      [2606:4700:e4::ac40:a90f]: "<!DOCTYPE html>\n<!--[if lt IE 7]>
      <html class=\"no-js ie6 oldie\" lang=\"en-US\">
      <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js "
    

    but i have added A name record for ask3 pointing my server IP

    should i get a certificate for my server using server IP?

  • @phenomlab said in how to configure DNS records virtualmin?:

    have you set the subdomain or root domain yet in VirtualMin?

    i have used subdomain

    just now i have tried to install the certificate for the subdomain following this but let’s encrypt is not give the certificate

    https://www.ssldragon.com/blog/install-an-ssl-certificate-on-virtualmin/

    in log it looks like i have not configured the DNS correctly

    Domain: ask3.domain.com
      Type:   unauthorized
      Detail: Invalid response from
      https://ask3.domain.com/.well-known/acme-challenge/WCSL3V7RqeaQd41WBlLDBPK19uaY0ODLDTtRWJqSU68
      [2606:4700:e4::ac40:a90f]: "<!DOCTYPE html>\n<!--[if lt IE 7]>
      <html class=\"no-js ie6 oldie\" lang=\"en-US\">
      <![endif]-->\n<!--[if IE 7]>    <html class=\"no-js "
    

    but i have added A name record for ask3 pointing my server IP

    should i get a certificate for my server using server IP?

    wrote on last edited by
    #4

    @hari no, that won’t work. The entire point of a certificate is that it is assigned to a hostname. Can you provide (information redacted) screenshots of your you have the root domain and subdomain configured in VirtualMin ?

    Or, I can check directly if you provide login details via PM.

  • wrote on last edited by phenomlab
    #5

    @phenomlab Hi sir, I’ve got 2nd dose vaccination and I’m suffering from fever and stomach pain. I will go through this after a week

  • @phenomlab Hi sir, I’ve got 2nd dose vaccination and I’m suffering from fever and stomach pain. I will go through this after a week

    wrote on last edited by
    #6

    @hari ok

  • @phenomlab Hi sir, I’ve got 2nd dose vaccination and I’m suffering from fever and stomach pain. I will go through this after a week

    wrote on last edited by
    #7

    @hari Just checking in - you feeling better now ?

  • @hari Just checking in - you feeling better now ?

    wrote on last edited by Hari
    #8

    @phenomlab thanks for asking, I got recovered after five days and later I was busy with fixing roof. I’ve turned off email notifications and didn’t checked this thread for the last two weeks.

  • @phenomlab thanks for asking, I got recovered after five days and later I was busy with fixing roof. I’ve turned off email notifications and didn’t checked this thread for the last two weeks.

    wrote on last edited by
    #9

    @Hari no issues at all. Fixing the roof sounds like fun

  • wrote on last edited by Hari
    #10

    today i have bought a new droplet, deleted the old one to avoid extra billing.

    i have added A name record at CF for ask8.domain.com and trying to get lets encrypt certificate and getting this error

    Requesting a certificate for ask8.domain.com, *.ask8.domain.com from Let’s Encrypt …
    … request failed : Web-based validation failed : Wildcard hostname *.ask8.domain.com can only be validated in DNS mode DNS-based validation failed :

    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator manual, Installer None
    Obtaining a new certificate
    Performing the following challenges:
    dns-01 challenge for ask8.domain.com
    Running manual-auth-hook command: /etc/webmin/webmin/letsencrypt-dns.pl
    Waiting for verification...
    Challenge failed for domain ask8.domain.com
    dns-01 challenge for ask8.domain.com
    Cleaning up challenges
    Running manual-cleanup-hook command: /etc/webmin/webmin/letsencrypt-cleanup.pl
    Some challenges have failed.
    IMPORTANT NOTES:
     - The following errors were reported by the server:
    
       Domain: ask8.domain.com
       Type:   unauthorized
       Detail: No TXT record found at
       _acme-challenge.ask8.domain.com
    
       To fix these errors, please make sure that your domain name was
       entered correctly and the DNS A/AAAA record(s) for that domain
       contain(s) the right IP address.
    

    do i need to add any c name record at CF for this?

    _acme-challenge.ask8.domain.com

  • today i have bought a new droplet, deleted the old one to avoid extra billing.

    i have added A name record at CF for ask8.domain.com and trying to get lets encrypt certificate and getting this error

    Requesting a certificate for ask8.domain.com, *.ask8.domain.com from Let’s Encrypt …
    … request failed : Web-based validation failed : Wildcard hostname *.ask8.domain.com can only be validated in DNS mode DNS-based validation failed :

    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator manual, Installer None
    Obtaining a new certificate
    Performing the following challenges:
    dns-01 challenge for ask8.domain.com
    Running manual-auth-hook command: /etc/webmin/webmin/letsencrypt-dns.pl
    Waiting for verification...
    Challenge failed for domain ask8.domain.com
    dns-01 challenge for ask8.domain.com
    Cleaning up challenges
    Running manual-cleanup-hook command: /etc/webmin/webmin/letsencrypt-cleanup.pl
    Some challenges have failed.
    IMPORTANT NOTES:
     - The following errors were reported by the server:
    
       Domain: ask8.domain.com
       Type:   unauthorized
       Detail: No TXT record found at
       _acme-challenge.ask8.domain.com
    
       To fix these errors, please make sure that your domain name was
       entered correctly and the DNS A/AAAA record(s) for that domain
       contain(s) the right IP address.
    

    do i need to add any c name record at CF for this?

    _acme-challenge.ask8.domain.com

    wrote on last edited by phenomlab
    #11

    @Hari Not typically. You’ll get this error if you also request a wildcard. Try it by itself, without the wildcard.

    If you really want to use a wildcard, you’ll need a DNS record identified as * pointing to the IP address of your server.

  • @Hari Not typically. You’ll get this error if you also request a wildcard. Try it by itself, without the wildcard.

    If you really want to use a wildcard, you’ll need a DNS record identified as * pointing to the IP address of your server.

    wrote on last edited by
    #12

    @phenomlab got it, now i got the certificate, how can i enable HSTS at virtual min for ask8 virtual server

  • @phenomlab got it, now i got the certificate, how can i enable HSTS at virtual min for ask8 virtual server

    wrote on last edited by
    #13

    @Hari Apache or NGINX ?

  • @Hari Apache or NGINX ?

    wrote on last edited by
    #14

    @phenomlab NGINX i guess ☺

  • @phenomlab NGINX i guess ☺

    wrote on last edited by
    #15

    @Hari Try this in your nginx.conf file

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    
  • @Hari Try this in your nginx.conf file

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    
    wrote on last edited by
    #16

    @phenomlab i think i missed this step, how can i make sure i am using NGINX

    32016667-856a-4dde-a4aa-832bb81e202a-image.png

    my current settings for ask8

    5b514fa7-f18c-4417-9e90-f0dc940acd28-image.png

    ask8 is not opening because i have opted for HSTS i want an origin server certificate 🙂

  • @phenomlab i think i missed this step, how can i make sure i am using NGINX

    32016667-856a-4dde-a4aa-832bb81e202a-image.png

    my current settings for ask8

    5b514fa7-f18c-4417-9e90-f0dc940acd28-image.png

    ask8 is not opening because i have opted for HSTS i want an origin server certificate 🙂

    wrote on last edited by
    #17

    @Hari How did you install Virtualmin on that droplet ? If you used the default commands, it is using Apache.

  • @Hari How did you install Virtualmin on that droplet ? If you used the default commands, it is using Apache.

    wrote on last edited by Hari
    #18

    @phenomlab i followed this video, now i went forward with apache and enabled SSL at virtual min and ask8 is loading ✅

    from our conversation i have learned how to create SSL and apply for our server (sub-domain) at Virtualmin.

    Virtualmin is so nice it has built-in SSH easy to access.

    now i am taking backup of live flarum for ask. virtualserver

    after uploading DB and files i will disturb if i face any issues.

    next, i should set up Redis …etc and need to change ask server to NGINX

    now deleting ask8 which is created to learn SSL

  • @phenomlab i followed this video, now i went forward with apache and enabled SSL at virtual min and ask8 is loading ✅

    from our conversation i have learned how to create SSL and apply for our server (sub-domain) at Virtualmin.

    Virtualmin is so nice it has built-in SSH easy to access.

    now i am taking backup of live flarum for ask. virtualserver

    after uploading DB and files i will disturb if i face any issues.

    next, i should set up Redis …etc and need to change ask server to NGINX

    now deleting ask8 which is created to learn SSL

    wrote on last edited by
    #19

    @Hari Ok, no issues. I tend to prefer NGINX over Apache2 myself.

    See below

    https://www.virtualmin.com/documentation/installation/automated/#LAMP_vs_LEMP

    Essentially, you need to suffix the install script with --bundle LEMP

  • @Hari Ok, no issues. I tend to prefer NGINX over Apache2 myself.

    See below

    https://www.virtualmin.com/documentation/installation/automated/#LAMP_vs_LEMP

    Essentially, you need to suffix the install script with --bundle LEMP

    wrote on last edited by
    #20

    @phenomlab yeah, i missed that

    i think migrating from apache to NGNIX is a bit complicated i will destroy this droplet and do the installation again.

    tried this, after running apt-get install nginx

    i thought this will get complicated

    https://www.digitalocean.com/community/tutorials/how-to-migrate-from-an-apache-web-server-to-nginx-on-an-ubuntu-vps


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee ☕
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • 3 Votes
    4 Posts
    5k Views
    phenomlab
    I’ve been using this service for a couple of days now, and it’s made my internet access so much faster. That alone is a plus, and I never thought there would be a contender for Cloudflare in this area.
  • Where to add to DNS settings for Google crawl

    Solved Configure dns
    4
    1 Votes
    4 Posts
    2k Views
    phenomlab
    @eveh yes, as the DNS will be natively registered there.
  • 6 Votes
    36 Posts
    15k Views
    phenomlab
    @justoverclock said in Digitalocean step by step guide to nginx configuration: i’m learning And that’s the whole point of this site If you don’t learn anything, you gain nothing.
  • 4 Votes
    8 Posts
    5k Views
    WesleyMoura
    @phenomlab Sorry to delay in responding, yes as i mentioned above, i had to remove my redis from docker and reinstall a new image with this command docker run --name=redis -p 127.0.0.1:6379:6379 -d -t redis:alpine and now when i test my ip and port on https://www.yougetsignal.com/tools/open-ports/ the status of my redis port is closed. I think which to configure firewall in droplet digital ocean is a good idea too, and i will configure soon. Thanks for the help!
  • Deploy React + NodeJs App

    Solved Configure digitalocean nodejs react
    25
    4 Votes
    25 Posts
    10k Views
    phenomlab
    @justoverclock Any update ? Thanks EDIT - marking as solved based on the below thread https://sudonix.com/topic/339/digitalocean-step-by-step-guide-to-nginx-configuration
  • Do i need more RAM? Plesk

    Solved Performance plesk digitalocean
    3
    1
    1 Votes
    3 Posts
    2k Views
    phenomlab
    @Hari welcome to Grafana, the most confusing stats package there is ! According to the guidelines, you certainly have enough RAM at 4gb https://www.plesk.com/blog/various/plesk-requirements-hardware-software/
  • Virtualmin Setup DigitalOcean

    Solved Customisation virtualmin digitalocean
    26
    9 Votes
    26 Posts
    13k Views
    phenomlab
    @Hari said in Virtualmin Setup DigitalOcean: i have felt it is very hard to manage Virtualmin the settings are confusing It’s a bit of a learning curve, admittedly, but very powerful and easy to use provided you understand the implications of what you are doing. For example, moving a VirtualMin server to subserver and then back again without changing underlying components that rely on the correct placement of the server, of course it will no longer work.
  • Digitalocean Ubuntu configuration

    Solved Linux
    33
    12 Votes
    33 Posts
    14k Views
    justoverclock
    @phenomlab thank you! not me