I am using an Amazon EC2 instance to serve a node.js app. I recently purchased a domain name through Google Domains and I want to use that domain name to access my node.js app.
The Google Domains console allows you to forward your domain traffic to another website. I set it to forward traffic to the public IP address of my EC2 instance. I can access my app just fine now, but when I type www.myDomainName.com into a web browser, the URL bar immediately changes and displays the digits of my EC2 IP address.
I would like the URL bar to display the name of my domain instead.
Note:
I have read a few SO questions related to this and can't figure it out. Some of them are a bit over my head. Many of them say to use an Amazon Elastic IP, but I don't understand why this is necessary if the public IP of my EC2 instance seems to work just fine. If the solution here is to use Amazon Elastic IP, I would really appreciate an explanation as to why that is necessary,
It sounds like you are using Google Domains to redirect to another site once the request has hit the Google servers. This is fine and dandy if you have another domain you are wanting to redirect to.
If you want it to stay under your domain name, but point to another location you need to actually change the DNS entries for your domain.
Go to Google Domain services and change your master(*) (A) record, as well as your WWW (A) record, to point at your public IP address. That way when a DNS request is sent for your domain it will just ask Amazons' servers what to do instead of using a redirect from Google.
Exact Steps:
From the Google Domain Website, click the Middle Tab () to open DNS settings
Fill out the form near the bottom of the page titled, Custom Resource Record
Name: In this scenario we want to use "#" or "www"
# is the root record (or anything not specifically set)[all]
www is the record for when people type www.example.com
Type: There are two types; A refers to IPv4 address and AAAA refers to IPv6 address
You can set both of them separately, generally you want to use the A [IPv4]
TTL: Time to live, recommend leaving 1hr (this is an advanced attribute)
Data: The actual IP address you are wanting to point to (your website)
Example: 8.8.8.8 [Google Nameserver]
Now that are the blanks are filled out, press the "Add" button
Wait for the records to be updated publicly
This will take approx. 1hr (as long as you kept TTL at 1hr)
This step can take longer depends on Google's servers
Check your website www.example.com to confirm it has updated
Addendum to Zax's Answer
While Zax's answer is fully accurate, it looks like it wasn't sufficient to help out the OP, and maybe not for others, too.
When you go to Google Domains (at least as of March 2017), you'll see several different tabs. The middle tab, which looks like is the tab to configure the DNS. Chose that tab.
Near the bottom of the page on the DNS tab you'll see a section Custom resource records. Within that section, you can add more entries. An entry consists of:
Name: this is briefly described by Google, but in short, likely you'll either want to use # or www, where the former means "root level" and the latter means "www subdomain".
For instance, if you registered imsocool.com, then # points to imsocool.com whereas www points to www.imsocool.com.
Type: you'll probably either want A which is an IPv4 Address or you'll want AAAA, which is an IPv6 Address. (That's assuming you're trying to point to a website, not an e-mail server or whatever else.)
TTL: time-to-live, I don't think you'll need to worry about it much, so just use the 1h (one hour) default.
data: again, presuming you are pointing to a website, that will be the actual IP address. E.g., 54.49.66.128, or whatever your IPv4 (or v6) server address is.
Once you've filled in all the blanks, simply hit the blue "Add" button.
Wait a while for the DNS update to happen.
The most it should take is 1 hour, if that's what you had placed above. But it could potentially be much quicker.
Then check to see that all is working by visiting your site using the name, e.g., imsocool.com.
In your google domain admin dashboard, select the dns configuration of your domain name.
Go to Custom resource records and set a new record with the subdomain you require: for the site webapp.example.com use webapp and select Type A. Leave blank the ttl field and add you public IP from the amazon EC2 instance. Then just browse the site webapp.example.com and it will retrieve the site on your EC2 under the domain name.
If you need to redirect the www.example.com domain then just add a record with www, also selecting the type A and adding your public IP from your EC2 instance.
Related
So, I've created a website xxxxxxx.com (removing from post)
I registered it with Route 53.
Registered Domain - Established Hosted Zone
Established 2 Record Sets one of xxxxxxxx.com and one for www.xxxxxx.com
Record Set Details for one of the paths
But when I go to ping www.xxxxxxxx.com or xxxxxxxx.com - I don't get a response.
When I go to a DNS checker site - it fails all DNS servers.
I've been all over the place trying to get this to work, concerningly, it did work at one time, but then failed. I have deleted the hosted zone twice and rebuilt it. I have NOT touched the named servers.
S3:
setup 2 buckets, named appropriately. xxxxxxxx.com and www.xxxxxxxx.com
Both have two files on them. Block public is unchecked.
Static Web hosting is enabled.
Selected both files and set to Actions --> Make Public
Testing on their own with these addresses:
**edited - I had to remove the direct S3 Web hosting as once posted here they got hammered with hits.
I did try one other thing:
Route 53 --> Traffic Policies --> Create Traffic Policy -->
DNS Type a: IP address in IPv4 format to Endpoint Type S3 website endpoint Value xxxxxxxx.com.s3-website-us-east-2....
This does not appear to have rectified the situation, unfortunately. And they want to charge $10 a month to direct it with www. prefix - which doesn't make any kind of sense, so I didn't do that.
Any advice or help that can be rendered would be helpful! I've covered most of the ground with Amazon and videos setting up domain to S3 to no avail.
Something seems off with your DNS records: https://www.whatsmydns.net/#NS/fojsan.com
Domain registered 2 days ago, should have NS listed in all regions. Leave the S3 for the time being and focus here. If DNS record can not resolve , S3 will not work.
Make sure that DNS entry for NS (name Servers) is set to:
ns-1145.awsdns-15.org.
ns-1694.awsdns-19.co.uk.
ns-20.awsdns-02.com.
ns-576.awsdns-08.net.
It looks like it might have been removed and are expiring.
I have been looking around the internet and I have come across a few different ways to link my AWS EC2 instance to my domain name. It looks like I could do it using Route 53 but I am not entirely sure on that process. The other way is to map it from google. These seem like the best instructions I have found for that: link a Google Domain to Amazon ec2 server
The question that I can not seem to find is what about my email address. I pay google so that I can have some email addresses name#mydomain.com. Now these work fine and I have had them up and running for months. But now I want to have my website (it is a web app) point to it. Because currently when you go to mydomain.com it says This site can’t be reached mydomain.com’s server IP address could not be found.
Some help here on how to do this would be great. I am afraid that I am going to set this up incorrectly and then lose access to my gmail account which I cannot have happen.
Your domain's email is configured via MX DNS records. You would point your domain to your EC2 instance by adding A or CNAME DNS records. The two configurations are completely separate. You will not break your current email setup by adding an A or CNAME record that points to the EC2 instance. You simply need to add that record in your DNS settings, wherever your DNS is currently hosted. You don't need to make any changes in your Gmail account configuration, and you don't really need to use Route53 either (although it does add some nice features). You had to configure the MX records somewhere at some point, to setup your G-Suite account for your domain. You just need to go into that same DNS configuration (most likely still hosted at the company where you initially purchased the domain name) and add an additional record.
I know this should be a pretty easy thing to do, but I'm having trouble.
Say I bought a domain name from 123-reg.co.uk "example12345.com". And I have a website hosted on AWS called something like http://lowcost-env.blahblahblah.us-west-2.elasticbeanstalk.com/.
I have read the following blog: https://www.thesitewizard.com/domain/point-domain-name-website.shtml and followed the steps, but still have 2 issues/questions:
1) I have configured "web forwarding" on 123-reg.com to forward requests to example.com to my convoluted AWS address, but when I type in example12345.com to a browser, it just says the DNS can't find that domain name. I set this up weeks ago, and did manage to see it work a couple of times, but weeks later it doesn't work anymore.
2) On the occasions I did see the web forwarding working, I notice that the browser displays the convoluted AWS address after the redirect happens. Is there a way to configure it so that users type in example12345.com into the browser, and then it's that address that is always displayed in the browser address bar whilst they are browsing around my website? Surely I need more than just web forwarding and a redirect?
Thanks!
You can use Route53 for pointing domain name to the AWS endpoint. Check the step 5 of this documentation :
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html
In Route53 you can point your domain to alias whereas in other DNS you need to specify IP address/CNAME. As in your case you are using endpoint from AWS you can map it to your domain.
You will also need to modify the nameservers to point to AWS.
I have a GoDaddy URL that I want to migrate to my website hosted on AWS EC2.
I have followed the steps to transfer the DNS by setting up a hosted zone on Route 53, copying the four Nameservers and saving them in GoDaddy as custom Nameservers.
This was three days ago and the change has still not taken place.
Any ideas as to what I have done wrong?
The url is: www.swsportspsychology.co.uk
These are screenshots of the AWS and GoDaddy accounts:
It appears that the domain is not registered!
I would recommend that you double check that GoDaddy actually took payment and submitted the registration - perhaps its still in progress however, I doubt this as you have stated its been 3 days.
Alternatively (and I would recommend this) if you plan to use this domain with AWS why not register it within AWS in the Route53 Service. As you can see from the image below the domain is available for registration in the AWS Console.
This will make management a lot easier in my opinion, however if you choose to pursue the GoDaddy registration it does look like you're all correctly configured to host that site's DNS when the registration takes place. Good work!
Update: Adding a DNS record to your domain
In this example we are going to configure the A record for your domain and WWW to point to your EC2 Instance.
Open EC2 and highlight your instance, make a note of the Public IP and the Pubic DNS values. Keep these handy.
Open Route53 and click your hosted zone "swsportspsychology.co.uk"
Click the Blue "Add Record" button.
Using the panel on the right hand side;
Leave the Name value empty
Ensure the Record Type is "A - IPV4 Address"
Leave Alias set to "No"
Leave TTL as the current value
In the Value field, type in the Public IP of your EC2 instance only.
Click Create
This will create a record for swsportspsychology.co.uk that will take you to your EC2 instance. Now to setup WWW.
Click Create Record Set again
Using the panel on the right hand side;
Enter "www" in the name field
Ensure the Record Type is set to "CNAME - Canonical Name"
Ensure that the Alias value is set to "No"
Leave the TTL value as the default value
Set the Value field to be the Public DNS value for your EC2 instance that you recorded earlier.
Click Create
You should now be able to access your website by visiting "www.swsportspsychology.co.uk"
I have an AWS instance of a web application written in Python/Django/Java.
My domains are hosted at godaddy and we set the "A record" for www.learn.MyDomain.org to the AWS IP address. I also set the "A record" for www.learn.myOtherDomain.org at the same IP address, and now both work great.
Can I set an unlimited number of "A records" to the same IP address without causing problems?
To be clear - I want to send all domains to the default website.
Why? We would like to share our web app with other orgs, and it would be great if it appeared to their users to be owned by their own org.
Is this problematic? Are there limits?
There should be no problem linking a lot of domain names to the same ip address. You will however have to add the domain names in your webserver config, unless you send all domains to the default website.
This is no problem, shared hosting works on this principle.