The majority of applications in production use an External IP address (instead of the Shared Load Balancer, provided by default) as more secure and effective entry point. So, to attach a custom domain for such environments, a special A Record is required.
A Record is an entry in your DNS zone file, that maps each domain name to IP address. For example, when you type www.mycustomsite.com, browser goes to the nameserver and asks for the mycustomsite.com A Record. This record should point to the appropriate IP address of your web or balancing server.
1. Log into your domain registrar account (as an example, we use GoDaddy). Expand Sign In option at the top and click the same-named button.
2. Fill in your GoDaddy credentials to authenticate and switch to your account manager by clicking the Visit My Account button.
3. Expand your DOMAINS list, find the required one and click on Manage DNS for it.
Tip: In case you don’t have any domain yet, follow the Get one now link to purchase it.
4. At the bottom of the Records section, click the Add button.
5. Within the shown Add Zone Record frame, select the A option from the Type drop-down list.
6. Complete the A Record addition.
- Host - enter hostname the A Record is linked to - in our case, just type @ to point record directly to your domain name
Points to - specify external IP address of your environment entry point
Tip: To get this IP, expand your application server (load balancer) layer and use Additionally button to see your node Public IP address (the second one).
TTL - select for how long the DNS server should keep your A Record information cached (i.e. the delay before new settings for it will be applied in case of their further change)
Click Save.
Note: Any DNS changes you make can take up to 48 hours to be reflected throughout the Internet.
7. That's all! Now, open a new browser tab and enter your custom domain name to the address bar.
You'll see the home page of your application, which means that everything is setup properly.