You are here:

I'd like some help please in learning how to create DNS records using the WordPress appliance on Amazon. Here's what I'm trying to do:

We have a live server on the internet that has a small number of sites running WordPress multisite.

We need to rebuild this WordPress multisite installation, and I'm hoping to use Turnkey WordPress on Amazon as a place to build a clone of the real system which can then be migrated out to the live environment.

Let's say my parent site is parent.com and the sub-sites are subsiteA.com and subsiteB.com.

I have to use the actual domain names in both environments. What I had planned to do was to edit the hosts file on a PC so that visiting parent.com, subsiteA.com and subsiteB.com go the the IP address (elastic) of my Turnkey Cloud Appliance.

For that to work I need to be able to create A records and CNAME records and sub-domains on the server appliance itself so that traffic is routed appropriately. I don't want these records to be created in any sort of public DNS system because there's still a real live site out there that needs to carry on working.

I'm used to using Advanced DNS Editor in Cpanel on other servers. Where do I find/install/activate/access something like that on Turnkey WordPress EC2?

Adding the IP to your hosts file should do the job fine. I'm not sure why you'd also need to create DNS records? When you try to connect to a url, the first thing that is checked is the hosts file. If a entry exists there then DNS is never querried. It's only when no hosts record exists that your PC will ask DNS for an IP...

Regardless though, if you want to install a local DNS server on your appliance then you could do that too. Then just make your server your primary DNS (on your local computer.

To install DNS:

apt-get update
apt-get install bind9 webmin-bind9

Then you can configure it through Webmin.

Where this whole idea will possibly fall down though is that unless you have an elastic IP associated with your appliance, the pubic IP may change and you will lose domain based contact with your server (whether you go the hosts or DNS route). The only other way around that is to use alternative domain names (so they don't interfere with your real site). You could use HubDNS for that and one of the free tklapp.com domain names...

Thanks Jeremy for taking the trouble to suggest a way forward. I think I have an approach that will work now, but I haven't tried it yet. I'll post back when I do.

I'm creating a copy of a live WordPress multisite installation. WordPress multisite installations use several URLS for different sites, so we need to be able to create and edit a series of CNAME and A records within DNS.

Here's what I'm going to try:

I have a Turnkey WordPress Cloud Server with Elastic IP

I have PC (in fact a local virtual machine) that will connect to the Turnkey WordPress Cloud Server

Only the PC will be allowed to access the Turnkey WordPress Cloud Server (firewall rule)

The hosts file on the PC will point to the Turnkey WordPress Cloud Server's elastic IP for all the domains in our multisite network

Inspired in part by Jeremy's response, I'm going to try using the hosts file as a sort of substitute for CNAMEs and A records, pointing each domain and subdomain that is required at my Elastic IP address by editing the hosts file.

The real-world name servers for the sites won't change, so the rest of the world will see the live sites

It's point 5 in that list that I'm unsure about. I'll let you know how I get on.

Just a quick update, I found that I didn't need to set up any Virtual Hosts on the server to create the environment that I needed. It was enough just to have the hosts file.

I believe that this piece of luck is specific to the task that I was attempting, which was to work with WordPress multisite. WordPress Multisite's own sunrise and domain mapping must be doing some of the work here.

To recap, I'm using WordPress Multisite with a sub-domain configuration and the WordPress MU Domain Mapping plug-in. parent.com is the parent site, subsiteA.com and subsiteB.com are sites on the multisite network.

Here's what my hosts file looks like, except of course xxx.xxx.xxx.xxx is really my Elastic IP address and not a load of x's.