Create a CNAME Record
A CNAME record is typically used when running multiple services from a single IP address. For example, you need to run an FTP server (ftp.example.com, port 21) and a Web server (www.example.com, port 80) on the same IP address. In this case, each server would have a separate entry in edjDNS.
A CNAME record consists of the following data:
-
Name: The name to use as the alias.
-
TTL: The time duration, in seconds, for which a record can be retained in the recursive resolver’s cache.
-
Target: The domain name of the primary domain owner.
When adding a CNAME record to a Full domain zone setup type, remember the following limitations:
-
Only one CNAME record is allowed per domain name.
-
Co-existing with any other record is not permitted.
-
Recursive CNAMEs (pointing to oneself) are not permitted.
When adding a CNAME record to a CNAME domain zone setup type, consider the following limitations:
-
Recursive CNAMEs are not permitted.
-
Record NAMEs cannot be @.
-
A and AAAA records are allowed.
In this tutorial you will create the CNAME record to use the same IPv4 address as the A record.
Therefore, if the IP address changes for the A record, ftp
, all CNAME records using the A record as the target will be auto-updated with the IPv4 address.
TYPE | NAME | TARGET | TTL | PROXY |
---|---|---|---|---|
A |
ftp |
192.168.1.5 |
1800 |
disabled |
CNAME |
blog |
ftp.host.com |
1800 |
disabled |
To create a CNAME record blog
to the Full domain zone setup type (FQDN) ftp.host.com
:
The following example implies that the A record, ftp with IPv4 address 192.168.1.5 , was previously created.
|
Use EdjConsole
-
Log into EdjConsole.
-
Switch to the organization associated with the domain you want to add the record to.
-
Navigate to Main Menu > Domains.
The Domain page displays. -
Click on a domain.
The Domain Attributes page displays. -
Click Create Record.
-
Do the following:
-
TYPE: Select CNAME.
-
NAME: Enter the name to use as the alias. For this example we use
blog
as the name for the Web server. -
TARGET: Enter the A record domain name. For this example we are using the A record called
ftp
as the primary domain. -
TTL: Enter the TTL value in seconds. For this example data from this record will be cached for 1800 seconds.
-
PROXY: Select if you want edjDNS to be your proxy server for this record. For this example edjDNS will not be the proxy server; therefore, it is disabled.
-
-
Click Save.
The CNAME record is added to the list of resource records for the domain.
Use EdjCLI
-
Log into EdjCLI.
edjx login Username: <string> ✔ Password: **********█ Logged in successfully root@edjx:~ #
-
Switch to the organization associated with the domain you want to add the record to.
edjx config organization -i
-
Select the domain to add the record to.
edjx config domain -i
-
Create the CNAME record.
root@edjx:~ # edjx domain records create blog CNAME ftp.host.com 1800 Record created successfully. Record ID: 2893b65b-6f5c-4ac7-a464-8b5192ee073d
See edjx domain records create for additional details.