Registering a domain with AWS CLI commands

If you need to register domains regularly, or if you are building a website (such as a domain registration website), you will need to use the APIs instead. You can register domain names with AWS CLI commands through the register-domain sub-command of the route53domains command:

  1. We will first check the availability of the domain that we already registered:
aws route53domains check-domain-availability 
--domain-name qnatime.com
--profile admin

This command will provide us with the following response:

Now, check for another domain, which is not registered:

aws route53domains check-domain-availability 
--domain-name qnatime.net
--profile admin

This command will provide us with the following response:

In the real world, you may have to do some trials until you find a domain that is available. There are also websites that can help you find all available domains with a partial input, such as a prefix.

  1. Create a contact information JSON file, as follows:
{
"FirstName": "Heartin",
"LastName": "Kanikathottu",
"ContactType": "PERSON",
"OrganizationName": "NA",
"AddressLine1": "<Your AddressLine1>",
"AddressLine2": "<Your AddressLine1>",
"City": "Bengaluru",
"State": "KA",
"CountryCode": "IN",
"ZipCode": "<Your PIN>",
"PhoneNumber": "+91.XXXXXXXXXX",
"Email": "Your email"
}
+91 is the country code for India. It has to be followed by a dot, and then the actual number. I will reuse the same contact JSON for all of the contacts. You can create different files, if necessary.
  1. Finally, execute the register-domain sub-command:
aws route53domains register-domain 
--domain-name 'qnatime.net'
--duration-in-years 1
--no-auto-renew
--admin-contact file://resources/contact.json
--registrant-contact file://resources/contact.json
--tech-contact file://resources/contact.json
--privacy-protect-admin-contact
--privacy-protect-registrant-contact
--privacy-protect-tech-contact
--profile admin

This command will immediately return an operation ID:

You can check the status of your pending operation by using the get-operation-detail sub-command, as follows:

aws route53domains get-operation-detail 
--operation-id ba6b494d-9e86-4acc-8904-3ba861228916
--profile admin

This will return a response similar to the following:

You can verify the payment from your AWS Management Console, as follows:

    1. Log in to AWS Management Console, and go to My Billing Dashboard
    2. Click on Payment Methods
    3. Click on Make Payment
    4. Click on the Pay Now action for the domain registration expense, and make the payment.

After the payment, you can wait, and then run the get-operation-detail sub-command again. This time, you should get a different message, as follows:

You will get an email for verification. Verify your email address by clicking on the link.

As we mentioned at the beginning, the processes related to Route 53 may take some time to complete. So, you can wait for a while, and then try to run the get-operation-detail sub-command again. If everything goes fine, you will see something like the following:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.126.56