aws charging me for dns query - amazon-web-services

I have an ec2 instance under the free tier of aws and I am using route 53 hosting with it. In my bills, I am seeing charges for DNS-queries. But I don't get these on other servers I own on other accounts. Is it because I have configured it wrong? Please help

If you are using an A-record, then there is a charge ($0.40 per million queries).
However, as per the Route 53 pricing page:
Queries to Alias records that are mapped to Elastic Load Balancers, Amazon CloudFront distributions, AWS Elastic Beanstalk environments, and Amazon S3 website buckets are free.
To use this, select "Alias = Yes" and point to one of those resources. (But it appears an EC2 instance is not one of them, unless fronted by a Load Balancer.)
Worst case... pay the 40c!

Related

Do I need to upgrade our hosting plan if I just use it for domain but hosting the files on AWS?

The current setup was the application is load-balanced at AWS. The domain(www.Example.com) we are using is registered at GoDaddy.com.
My concern is that, do we need to upgrade our GoDaddy hosting even if the files are load-balance at AWS?
Let's say that we have had a 50K concurrent users.
Thanks for the insight in-advanced.
When you say "the application is load-balanced at AWS", it suggests that there is the following setup on AWS:
One or more Amazon EC2 instances running a web application, and
An Elastic Load Balancer that is directing incoming traffic to those instances
Your GoDaddy account probably has a Domain Name with a CNAME record that points to the DNS Name of the Load Balancer on AWS.
If this is true, then you do not need a "hosting plan" on GoDaddy, since it would just be managing your Domain Name. Scaling is not necessary for Domain Names.
Increasing the load would possibly require creating additional EC2 instances on AWS, but you might have an Auto Scaling group doing this for you automatically.
You should investigate what you actually have on GoDaddy and on AWS.

AWS - Monitoring outgoing DNS queries on VPC

I would like to monitor all outgoing DNS queries originating from resources within my VPC. For example, i would like to log all DNS queries originating from a specific EC2 instance. Is this possible?
I have looked into Route53 (early beginner to AWS), and from what i understand - using this i can only monitor my private domains, for incoming queries. Is it possible to monitor outgoing queries?
As far as I know, AWS doesn't have this as a feature right now. One solution that I've worked with before is having dnsmasq (a lightweight DNS cache/proxy) installed on every instance, configuring the machine to forward requests to dnsmasq first, and then consolidating your machines' dnsmasq logs in one place.
Currently there isn't any way.
.2 VPC DNS server queries don't log into VPC flow logs so you can't see there anything.
From AWS annoucement on 27th of August, 2020
https://aws.amazon.com/blogs/aws/log-your-vpc-dns-queries-with-route-53-resolver-query-logs/
"The Amazon Route 53 team has just launched a new feature called Route 53 Resolver Query Logs, which will let you log all DNS queries made by resources within your Amazon Virtual Private Cloud (VPC). Whether it’s an Amazon Elastic Compute Cloud (Amazon EC2) instance, an AWS Lambda function, or a container, if it lives in your Virtual Private Cloud and makes a DNS query, then this feature will log it; you are then able to explore and better understand how your applications are operating."
Therefore, if you use AmazonProvidedDNS (Amazon Route 53 Resolver) for DNS, then now you can use above option. The log contains a "srcaddr" field to find the source (e.g. EC2) of DNS lookup.

How does Route 53 charge?

I bought a domain not from AWS and setted it up using route 53 with amazon. The ec2 instance is just running from 2 days without any server running on it (I'm still working on the coding part) but I setted up route 53. Today in my billing I saw this:
How does it work? I'm still in free tier so I'm not sure if it was covered or not. Even if it was, how did AWS charged 50 cents for 2 days routing when no one visited my site and nothing was running on the ec2 instance? Can somebody explain?
Most likely the minimum charge for DNS queries or/and for your hosed zones. If you go to billing dashboard, you will clearly see the itemized charges under Route53. I see the following itemized charges in my billing dashboard. Even if your dig your DNS, it is considered as a query.
Route53 charge you for creating a Hosted Zone (Which is essential to use Route53 Service) which is not under the free tier category. It seems, you were charged for the Hosted Zone created, which is a monthly recurring charge of $0.5 per month, per hosted zone.
Additionally Route53 charges for data transfer as well and for detailed pricing, check this link.

Amazon Lightsail Subdomain Setup

I'm currently moving all of my hosting from a cheap shared hosting provider over to Amazon LightSail. Normally, when sending work over to clients for approval, I create a subdomain through my hosting provider's c-panel and upload the required files through FTP.
I am at a loss when it comes to setting up a subdomain through AWS Lightsail though. I've created a static IP and I've created the A record for the subdomain, but where do I put the directory that the files I want my client review for that subdomain sit and what IP address do I need to point the subdomain at?
AWS LightSail is different from shared hosting providers, where AWS provides Virtual Private Servers(VPS) with its own IP.
Generally VPS is for a single deployment of an application(e.g Single Wordpress Deployment per VPS). So it is recommended to get multiple VPS for your deployments unless your applications are really light weight and gets less traffic.
There is also a limit where you gets 2 VPS servers per AWS account by default. If you need more VPS, either you can send a support request to Amazon and increase the limit or use multiple AWS accounts (If you own the AWS accounts, you can setup consolidated billing)
In DNS setup, since its single application per VPS, you need to create a A record for each subdomain.
I had faced the same problem. I had used up 2 Lightsail instances per account as the other answer mentioned. I had no way to setup subdomain for another application I hosted on Elastic Beanstalk.
Solution is - Use Route53 & Create Hosted Zone there. Instead of creating DNS Zone in Lightsail. Then point A record to the Static IP of Lightsail.
Hope this solves your problem.

Do I have have to use Amazon Route 53's DNS Service (and pay for it), if I register and manage my domain with them?

I have worked with several godaddy domains in the past. But, for the new project infrastructure I wish to setup, I am planning on registering domain names from the new Amazon's Route 53 - Domain Registration.
My question is do I also need to pay for their DNS Service?
In the past I used to configure hosted zones (CNAME records) from the GoDaddy Console, but never payed anything extra.
How will relying on Amazon effect me in terms of cost and maintenance?
Update: Alright, looks like Amazon doesn't charge for DNS queries routed to their own internal services. Refer here: Route 53 Docs - DNS Service
If somebody is using Amazon Route 53 - Domain Name and their DNS, please let me know if/how you got charged for using their DNS Service.
From the documentation, notice the final step listed in registering a domain, when you want to use an external DNS hosting provider:
(Optional) Delete the hosted zone that Amazon Route 53 created automatically when you registered your domain. This prevents you from being charged for a hosted zone that you aren't using. (emphasis added)
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html
Regarding other providers' pricing practices:
In the past I used to configure hosted zones (CNAME records) from the GoDaddy Console, but never payed anything extra.
That's fine, but you're looking at this situation upside-down. The two services -- domain registration and DNS hosting -- are separate services, but GoDaddy and many other registrars don't give you an option not to pay for DNS hosting, even if you don't use it -- it's built into their domain registration pricing. AWS tends to unbundle service components so that you only pay for the components you use.
If you are hosting services in AWS, using S3, CloudFront, or Elastic Load Balancer, you will find that Route 53's DNS hosting is the preferable option, because of the way resource records work at the apex of a domain due to the design of DNS itself. Route 53 is integrated with the other services to allow failover and redundant DNS configuration in a way that can't be accomplished with most external DNS providers.
Yes, you can use third party DNS service with domains registered in Route53 (you just have to add appropriate Name Servers)
About the pricing, it is all explained in detail here. Keep in mind that although queries to Alias records that are mapped to Elastic Load Balancers, Amazon CloudFront distributions, AWS Elastic Beanstalk environments, and Amazon S3 website buckets are free, that does bot apply to other AWS resources, including Amazon EC2 instances and Amazon RDS databases.
Also you will be charged fixed monthly amount for each hosted zone.