How to configure dns sub-levels on aws without Route53? - linux

I have an EC2 instance (Amazon AMI) on AWS and I have a purchased a domaine name on Gandi.net.
Let's imagine my domain name is "teaorcoffee.com".
On Gandi, I have set up a sub-domain name "dev" to delegate DNS to my EC2 instance. Here is the configuration in the zone file on Gandi :
dev 10800 IN NS ec2-22-222-222-22.eu-west-1.compute.amazonaws.com.
I would like to configure sub-domain of "dev.teaorcoffee.com" on my EC2 instance, like "sql.dev.teaorcoffee.com".
I am trying to do that with :
the "bind" util
the file "named.conf.local" wich is included in the file "named.conf"
and a "dev.teaorcoffee.com" zone file
but without success.
Here is the "named.conf.local" file :
zone "dev.teaorcoffee.com" IN {
type master;
file "/var/named/dev.teaorcoffee.com";
allow-update { none; };
};
Here is the "dev.teaorcoffee.com" zone file :
$TTL 60
# IN SOA master.dev.teaorcoffee.com. support.teaorcoffee.com. (
2013030300
60
60
60
38400 )
dev.teaorcoffee.com. IN NS master
master.dev.teaorcoffee.com. IN A 127.0.0.1
sql IN CNAME master
I can restart the dns without any error with the command :
sudo /etc/init.d/named restart
But when I am trying to do a nslookup on "dev.teaorcoffee.com" and its sub-domain, I get the following error :
nslookup dev.teaorcoffee.com
Server: 127.0.0.1
Address: 127.0.0.1#53
* Can't find dev.teaorcoffee.com: No answer
What can I change to make it work ?
Thanks in advance for any help.

Once you have created an A record for your subdomain poiting to your EC2 server you are good to go.
If you're going to use Apache just configure the virtual host in your apache httpd.conf http://httpd.apache.org/docs/2.2/vhosts/examples.html
If you are going to use like a mysql server, there is nothing to do.
Just make sure the port of the services you are going to use are opened in your EC2's security group.
And an advice, migrate your domain zone to route 53 - is much easier to admin.
HTH

Related

RPZ (response policy zone) in Windows Server 2019?

BIND9 have very good function RPZ.
You can create DNS zone (like malware) and add malicious domains in it.
DNS server in response is giving my defined IP address aka DNS Firewall
[zone file]
...
$ORIGIN com.malware.
$TTL 5 ; 5 seconds
example A 127.0.0.1
[request]
$ dig example.com +short
127.0.0.1
[log]
(example.com): rpz QNAME Local-Data rewrite example.com/A/IN via example.com.malware
I wondering, if Windows Server 2019 DNS have the same native functionality?
I read all documentation regarding DNS Policy without any luck

CNAME record pointing wrong host

I'm using pythonanywhere.com to host a website, and I bought a domain "aquienvoto.uy", in my dns provider I created the following CNAME record:
And I get the following error at pythonanywhere.com...
If I run dig command this is what I get...
www.aquienvoto.uy. 3600 IN CNAME webapp-543799.pythonanywhere.com.aquienvoto.uy.
What I'm doing wrong?
I got an answer from nic.com.uy, the domain provider. I was missing a '.' at the end, correct configuration is webapp-543799.pythonanywhere.com.

How can I connect domain to aws whm

I have a domain bought from GoDaddy. I have set the custom name servers this
ns1.domain.com
ns2.domain.com
and set hostname
ns1 52.70.xxx.xxx(aws ip)
ns2 52.70.xxx.xxx (aws ip)
As I have installed WHM in my amazon aws instance. so In WHM, I have created an account and then went to Edit DNS Zone and added A records. These are my settings there
But I don't see my domain working and I am not able to see Cpanel of the domain as well.
what am I missing?
Please follow these steps to integrate your domain into whm and create a cpanel.
Create an account in WHM by going into Account Functions->Create Account: enter your domain here
Go to DNS Functions->Edit Dns Zone and click your domain and add A records
Then Go to Godaddy or any Company where you have purchased your domain and edit the name servers. For example if the nameservers you set in whm dns were ns1 and ns2 then same add here(e.g godaddy). In your case it would be
ns1.domain.com
ns2.domain.com
Click Manage hostname in Godaddy and add
ns1 52.70.xxx.xxx(aws ip)
ns2 52.70.xxx.xxx (aws ip)
Your domain should be working here. But If still It didn't work then
Check if ports(2087,2083,53,2095) are open. Check it from the terminal
nmap -Pn -sT 172.31.iphere --reason -p 2087,2083,2095,53
If any port is closed. Open it from the aws by going into Security Firewall.
Please note, 2083 and 2095 will always show as closed from external port scans as these ports are only opened publicly based on valid sessions established from within the cPanel server.
Verify again if your DNS port is opened
nmap -Pn -sT 172.31.iphere --reason -sU -p 53
After opening all the ports rebuilt your DNS configuration on the server by typing these commands on the terminal
cpanel root#9449099 /var/named]cPs# cd /etc
cpanel root#9449099 /etc]cPs# mkdir /root/cptechs
cpanel root#9449099 /etc]cPs# mv named.conf /root/cptechs
cpanel root#9449099 /etc]cPs# mv rndc.* /root/cptechs
cpanel root#9449099 /etc]cPs# /scripts/rebuilddnsconfig
Hope it helps
Are you using Nameservers for domain.com that are ns1/2.domain.com?
If this is the case the domain will not be able to resolve without adding the ns1/2. as "Child Nameservers".
You can create that for your domain through GoDaddy https://uk.godaddy.com/help/add-my-own-host-names-as-nameservers-12320
Alternatively - you can post your domain so we can troubleshoot it if it's a DNS issue.

cPanel Server Incorrect URL Resolve

My cPanel server is resolving a URL wrong. The website example.com is hosted on my cPanel server at ip 1.0.0.1. In a script I am attempting a cURL command to cp.example.com which is hosted on another server at 2.0.0.2. My server is resolving cp.example.com to the IP of 1.0.0.1. Any help will be greatly appreciated!
It seems like your dns settings for cp.example.com are not visible on the host where you are running your script. You should check the dns settings for cp.example.com. You may also want to contact the Cpanel support
When you make a cURL request from a source hosted on your cPanel server the IP for the domain is first resolved locally, if it's not found in your Server's DNS zones it will be resolved from your configuration at /etc/resolv.conf
You can test to see which IP your server is resolving this by logging via SSH and pinging it
Executed from your cPanel Server
ping cp.example.com
I can think of two workarounds for this issue:
If example.com's DNS zone is hosted in your cPanel account
Go to cPanel -> Zone Editor
Open the DNS zone for example.com
Find the A record for cp.example.com
Change it to 2.0.0.2
If you have root - edit your WHM / cPanel Server's /etc/hosts file
root#server #: vim /etc/hosts
// 2.0.0.2 cp.example.com

Webmin local development with name based virtualhosts

Hi i am trying to name based virtual hosts for my localhost.I was using wamp with name based virtualhost before but now im working on ubuntu.I thought webmin can be easy but when i create first virtual host all requests redirecting first virtual host even localhost,second virtualhost and phpmyadmin.
So how can i set webmin for reach each of them separately.
hosts config
127.0.0.1 www.adres1.com #working fine
127.0.0.1 adres1.com #working fine
127.0.0.1 www.adres2.com
127.0.0.1 adres2.com
Its because you are using a local server and your all domain will by default search 127.0.0.1 or your IP. So untill you declair them as CNAME in your zone file or do a entry in host file, they all will work as alias of a single domain. Thanks... :)

Resources