Chapter 9: Domain Names, DNS and Subdomains
9.4 Before you point a domain: prepare the server
Friends, the server must be ready before you point a domain. Does the website work on the IP, is there an Elastic IP, and are ports 80/443 open – these three checks come first.
मित्रांनो, डोमेन पॉइंट करण्याआधी सर्व्हर तयार हवा. वेबसाइट IP वर चालते का, Elastic IP आहे का, आणि पोर्ट 80/443 ओपन आहेत का – हे तीन चेक्स आधी.
दोस्तों, डोमेन पॉइंट करने से पहले सर्वर तैयार होना चाहिए. वेबसाइट IP पर चलती है या नहीं, Elastic IP है या नहीं, और पोर्ट 80/443 ओपन हैं या नहीं – ये तीन चेक्स पहले.
- A working website on EC2, tested with
curl -I http://localhostandhttp://<PUBLIC_IP>(Chapters 7 and 8). -
An Elastic IP, so the address never changes after stop/start. Quick steps:
- EC2 console → Network & Security → Elastic IPs → Allocate Elastic IP address → Allocate.
- Select it → Actions → Associate Elastic IP address → choose your instance → Associate.
- Note the address, e.g.
13.233.10.25. SSH now uses this IP too.
(Charges, the default limit of 5 per region, moving an EIP to a replacement server and releasing it safely are covered in detail in section 14.1.) 3. Security group: inbound HTTP 80 and HTTPS 443 from
0.0.0.0/0(and::/0for IPv6).
Never point DNS to the auto-assigned public IP
It changes on every stop/start. Your domain would then point to an IP that may soon belong to someone else's instance. Always use an Elastic IP (or a load balancer).
Ravindra Bagale's Tip
Many students point the domain at the auto-assigned public IP and stop the instance at night. In the morning the IP has changed and the domain points to someone else's server. Always put only an Elastic IP in DNS – and see section 14.1 for what an Elastic IP costs.
Ravindra Bagale's Tip – मराठी
खूप students auto-assigned public IP ला domain point करतात आणि रात्री instance stop करतात. सकाळी IP बदललेला असतो आणि domain कोणत्यातरी दुसऱ्याच्या server कडे जातो. DNS मध्ये नेहमी Elastic IP च टाका – आणि Elastic IP चा खर्च section 14.1 मध्ये बघा.
Ravindra Bagale's Tip – हिंदी
बहुत students auto-assigned public IP पर domain point करते हैं और रात को instance stop कर देते हैं. सुबह IP बदल चुका होता है और domain किसी और के server पर जाता है. DNS में हमेशा Elastic IP ही डालो – और Elastic IP का खर्च section 14.1 में देखो.
Lab
Chala, tumchya web server la Elastic IP attach kara aani curl -I http://<ELASTIC_IP> ne 200 yetoy ka te bagha. Mag security group madhe HTTP 80 aani HTTPS 443 che rules aahet ka te check kara, aani Elastic IP kagdavar liha – pudhchya lessons madhe lagel.
Got it? Website running, Elastic IP attached, 80/443 open – once this preparation is done, pointing a domain is only a few minutes of work. Now let's move on to buying a domain.
समजलं का? वेबसाइट चालू, Elastic IP अटॅच, 80/443 ओपन – ही तयारी झाली की डोमेन पॉइंट करणं फक्त काही मिनिटांचं काम. आता पुढे जाऊया डोमेन विकत घ्यायला.
समझ आया? वेबसाइट चालू, Elastic IP अटैच, 80/443 ओपन – ये तैयारी हो गई तो डोमेन पॉइंट करना बस कुछ मिनटों का काम है. अब आगे चलते हैं डोमेन ख़रीदने.