Primary nameserver cannot be resolved from the rest of the Internet : Host test.example.com not found: 2(SERVFAIL)

7 posts / 0 new
Last post
#1 Wed, 11/06/2019 - 21:33
rkan

Primary nameserver cannot be resolved from the rest of the Internet : Host test.example.com not found: 2(SERVFAIL)

I know this is idiotic, but could someone help me getting my domain, eg example.com, to work with virtualmin? Eg, I would like to be able to access virtualmin from test.example.com:10000

During the Post Installation Wizard, I got this error (I was using my IP 108.62.5.36:1000 for interface): "Primary nameserver cannot be resolved from the rest of the Internet : Host test.example.com not found: 2(SERVFAIL)"

My VPS system is Ubuntu 18.04 LTS on digitalocean vps. My hostname name is test.example.com

My /etc/hosts are: 127.0.0.1 localhost 108.62.5.36 test.example.com test

Inside DigitalOcean my example.com is set as follows: A example.com directs to 108.62.5.36 3600
CNAME www.example.com is an alias of example.com. 1800
NS example.com directs to ns3.digitalocean.com. 1800
NS example.com directs to ns2.digitalocean.com. 1800
NS example.com directs to ns1.digitalocean.com. 1800

What do I need to set in Virtualmin and my DigitalOcean DNS to make it work?

Thu, 11/07/2019 - 03:35
Dibs

Did you read their docs on what records to create? - https://www.digitalocean.com/docs/networking/dns/how-to/manage-records/

Thu, 11/07/2019 - 10:43 (Reply to #2)
rkan

thanks for replying. Yes, I followed that page and my dns above is set up accordingly, or at least, to the best of my knowledge. I can access example.com, but not test.example.com or test.example.com:10000. I did set up an additional A record last night for test.example.com.

I can access the IP address, but not the domain, and the mailserver is not working because test.example is not resolved.

Thu, 11/07/2019 - 10:48
Dibs

You have an A record for the root domain, i.e. example.com, you also have a CNAME for www but you appear to not have a CNAME for test nor a wildcard entry to catch all other subdomains. In which case trying to access test.example.com is as likely to succeed as trying to access anything.example.com

EDIT: test can be resolved in a few different ways: as a CNAME or an A record (if it's for mail, maybe best to use an A record), or technically you could use a wildcard. As you added an A record last night - it can take up to 48hrs to propagate.

Thu, 11/07/2019 - 14:32
rkan

Hi Dibs, this is perfect, I will wait for propagation. In this case would adding a cname for test.example.com cause conflicts (now that I already have an A record)? thank you again for your time.

Thu, 11/07/2019 - 14:49 (Reply to #5)
Dibs

If you have an A record for test, don't bother adding a CNAME as well.

EDIT: you can use websites like https://dnschecker.org/ to check propagation. You'd need to enter in test.example.com and see where it's got to. You can also use commands (on windows) like nsloopkup and tell it to use a specific DNS server's IP address to do the resolution.

Thu, 11/07/2019 - 15:45 (Reply to #6)
rkan

Thanks for your help, and the website is really useful.