First, I take it you have a domain at a DNS provider? If not, none of this will work.
If so, you need to have an A record that points the name www to the IP address of the virtual machine. I run my own DNS servers, but if you're using a domain provider you should be able to do this via the provider's dashboard. What you need to start with is a record that looks like this:
Code:
www IN A 10.10.10.10
in the zone file for your domain. You've already set the ServerName directive in Apache, so I'm guessing you just haven't set up the DNS records correctly.
If you install the whois client in Ubuntu with "sudo apt install whois" then the command "whois mydomain.com" should return records like this:
Code:
Domain Name: UBUNTUFORUMS.ORG
Registry Domain ID: D104981837-LROR
Registrar WHOIS Server: whois.markmonitor.com
Registrar URL: http://www.markmonitor.com
Updated Date: 2018-09-07T09:02:45Z
Creation Date: 2004-10-09T16:28:59Z
Registry Expiry Date: 2020-10-09T16:28:59Z
Registrar Registration Expiration Date:
Registrar: MarkMonitor Inc.
[etc.]
Name Server: NS2.CANONICAL.COM
Name Server: NS1.CANONICAL.COM
Once everything is set up correctly you should be able to use the host command like this:
Code:
$ host www.ubuntuforums.org
www.ubuntuforums.org has address 91.189.94.16
www.ubuntuforums.org has address 91.189.94.12
Bookmarks