As an alternative to IP addresses, Perforce can issue licenses against Fully Qualified Domain Names (FQDNs). If you own the domain "example.org", Perforce could issue a license for "perforce.example.org"; this is the FQDN for the Perforce Server's host.
Perforce Server uses a DNS lookup to find the IP address it should be bound to. The DNS record for the FQDN must resolve to the host's internal IP address, or the Perforce Server will not start. This internal address is the one used on the server machine itself.
How can DNS records be kept up-to-date if the host restarts, or if the operating environment changes the IP address for some reason?
One solution is to use a service like DynDNS
(there are other similar services that should work just as well, but this is the only one covered here).
Implementation in the Amazon EC2:
A number of Amazon customers have asked "Can we use an Elastic IP address?"
Unfortunately, the answer is no. Elastic IP addresses are publicly visible IP addresses mapped to a server instance by Amazon's NAT firewalls. These IP address are not directly bound to the actual host where the Perforce Server is running. The addresses used directly by the hosts are always private and not globally routable, and subject to change.
To start, register your domain with the DNS provider; this requires a Zone in DynDNS. In the Zone, add a new hostname for your perforce server's host. Next, set up the DNS updater client on the cloud based server. We will cover 'ddclient', as it is the recommended client for DynDNS on Ubuntu and it works across a wide range of other platforms.
Install 'ddclient' with apt-get by running this command:
sudo apt-get install ddclient
Configure the client by modifying the file "/etc/ddclient.conf" so that it looks like the one below, with the appropriate FQDN on the last line:
Now DNS can be used to resolve the internal IP address of the Perforce Server. As the advertised IP address is not routable, and is internal to the Amazon cloud, the fact that the DNS service exposes the hostname of your Perforce Server should not be a concern. We can now issue you a license for the FQDN that will resolve correctly. It will continue to resolve correctly as long as the DNS records are kept up-to-date, and that is done automatically by 'ddclient'.
From the amazon instance, the FQDN should be pingable, and the address should resolve to the local instance.
This may require adding the FQDN to the /etc/hosts like this:
127.0.0.1 localhost perforce.example.org