0

I need to create a A-Record for a subdomain on server X to make it point to server Y, but the IP from server Y is changing from time to time.

Server Y also has a hostname / domain.

The A-record does just accept IPV4 Addresses.

Is there also a way to use the hostname / domain of server Y instead of the IP address somehow, or do I have to change the A-Record each day by hand?


I tried it with CNAME as suggested in the comment by user10489, but I get an error

Error: The DNS zone file is invalid. (Line 514: test.api.konfigurator.company.de: CNAME and other data)

enter image description here

Black
  • 419
  • 6
  • 18
  • Sounds like an XY problem. Maybe you want to use CNAME instead of A. – user10489 Jun 03 '22 at 11:31
  • I tried CNAME and I get `Error: The DNS zone file is invalid. (Line 514: test.api.konfigurator.company.de: CNAME and other data)` – Black Jun 03 '22 at 11:35
  • Please add excerpts from your zone file to your question. Unless the hostname in question is also used in an NS record, the CNAME should work but maybe you have the syntax wrong. – user10489 Jun 03 '22 at 11:58
  • I added a screenshot – Black Jun 03 '22 at 12:09
  • 1
    Just for kicks, try adding a `.` after the `.com` in your CNAME record. That should prevent the DNS server from trying to append the zone origin to it (i.e. `ec2-the-rest-of-it.compute.amazonaws.com.company.de`) – Brandon Xavier Jun 03 '22 at 14:58

2 Answers2

1

The error you got probably means you already have another record with that name ("CNAME and other data"). CNAME records can not coexist with any other ones on the same name.

Had you given real names, people could have helped you better.

And by definition, A record are for IPv4 address, and not anything else.

Patrick Mevzek
  • 9,273
  • 7
  • 29
  • 42
1

I figured it out. The problem was the existence of the subdomain itself.

I had to delete the subdomain test.api.konfigurator.company.de to create the CNAME record.

Black
  • 419
  • 6
  • 18