Replacing public IP with hostname for sites which configured using load balancer

Shyam Kumar 846 Reputation points
2025-05-14T04:00:31.98+00:00

I currently have sites accessible via URLs like http://<Public-IP>/videos and http://<Public-IP>/images. After configuring a load balancer, I can access these sites using the load balancer's public IP address.

Now, I want to replace the public IP with a custom domain name. Since I am testing this on my personal account, I'm not sure how to purchase a domain and configure it to work with the load balancer.

Could you please guide me on how to set up a custom domain name and link it to my load balancer?

my preference first will be using free domain if any instead of purchase.

Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
506 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sai Prasanna Sinde 6,645 Reputation points Microsoft External Staff Moderator
    2025-05-14T09:17:28.9766667+00:00

    Hi @Shyam Kumar

    In addition to the points provided by Deepanshukatara-6769,

    You can go for Dynamic DNS (DDNS) provider for free testing, the main advantages of using this, it is free, quick setup and works for testing your load balancer setup.

    Find a free DNS provider like No-IP, DuckDNS and FreeDNS and create an account and choose your subdomain.

    In your DDNS provider control panel, find the settings for your new subdomain. You will need to tell it which IP address to point to. Since your LB has a static public IP, you should be able to configure it as a standard A record.

    • Find where to add an A record for your subdomain. Enter your LB IP Address in the IP address field and save the changes and the DNS changes take time to spread across the internet. This can range from a few minutes to several hours and try accessing your site using the new subdomain.

    Or else:

    Purchasing and configuring a custom domain and below are companies authorized to sell domain names. Popular options include like GoDaddy, Namecheap, Google Domains and Cloudflare Registrar.

    Use the registrar's website to search if your desired domain name is available and purchase it and once you own the domain, log in to your registrar's account. There will be a section like DNS Management, Zone File Editor, Manage Domains etc...

    You can link the domain to your LB IP by following below steps:

    • Type: A
    • Host/Name:
    • Use @ or leave it blank for the root domain.
    • Use www for the www subdomain. You'll likely want to point both the root domain and www to your load balancer.
    • Value/Points To: Enter your LB Public IP Address.
    • TTL (Time to Live): This is how long DNS resolvers should cache the information.

    Save the changes and wait for the propagation and once propagation seems complete, try accessing your site using your new domain name.


    I hope this has been helpful!

    Your feedback is important so please take a moment to click 'Accept answer'.

    If you still have questions, please let us know what is needed in the comments so the question can be answered.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deepanshu katara 16,565 Reputation points MVP Moderator
    2025-05-14T05:54:41.7633333+00:00

    Hello Diptesh , Welcome to MS Q&A

    To set up a custom domain name and link it to your Azure load balancer, you can follow these steps:

    Purchase a Domain: If you don't already have a domain, you can purchase one from a domain registrar. Azure doesn't provide free domains, but you can use services like Freenom to get a free domain with extensions like .tk, .ml, etc.

    Configure DNS Settings:

    • Use Azure DNS or your domain registrar's DNS settings to create an A record. This record will map your custom domain to the public IP address of your Azure load balancer.
      • Navigate to your DNS Zone and select + Record set. Enter the following information:
        - **Name**: The subdomain or root domain (e.g., www or @ for the root).
        
              - **Type**: A
        
                    - **TTL**: Time to live, e.g., 1 hour.
        
                          - **IP Address**: The public IP address of your load balancer.
        
                          **Validate the DNS Record**: Use tools like nslookup to ensure that the DNS record resolves correctly to your load balancer's IP address.
        

    For more detailed instructions, you can refer to the Azure documentation on custom domains.

    By following these steps, you can successfully link a custom domain to your Azure load balancer.

    Please let me know if any further ques

    Kindly accept if it helps

    Thanks

    Deepanshu

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.