youtube.com -> error.persotld.com -> Redirect without installing mitm certs - redirect

What I currently have :
I have a custom dns (powered by python twisted), installed in local network and used by all my local devices. That makes me able to customize the answers at the dns Level. The result is that i can reply something like that :
"myprivatenextcloud.mycompany.com. 1062 IN A 192.168.0.7"
for exemple.
All those stuffs are to resolve some domains in my local network, and to limit/block some domains as ads domains, or/and porn.
I can currently "block" some domains because i am replying NXDOMAIN to the query.
for exemple :
; <<>> DiG 9.10.6 <<>> #192.168.0.3 youporn.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11662
;; flags: qr ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;youporn.com. IN A
;; Query time: 42 msec
;; SERVER: 192.168.0.3#53(192.168.0.3)
;; WHEN: Tue Oct 18 16:49:00 CEST 2022
;; MSG SIZE rcvd: 29
When the "browser" receives this message, it said something like "Cannot access to the website".
What i want :
Now i would like to "redirect" the domain to a other domain. For exemple youporn.com to error.mydomain.com
How can i do that?
I have tried differents things like CNAME (but not working, because of root domain & SSL Issue), DNAME, ANAME (ask for "youporn.com" replies "google.com")
But nothing is working.
The main probleme is that (I think) I cant use the classic redirect as HTTP 30X.
Because I shouldnt receive(and manage) the http request.
The other issue is about https (-> I can simulate with a virtualhost https://google.com, but the cert will be a selfsigned cert, and the browser will "reject" it. It can be solved with mitm. But it's not the goal of my project.)
If i can "redirect" before HTTP(S) calls, I will receive a classic/normal Http on http(s)://error.mydomain.com request and will be able to manage it.
I read somethings about TXT, but nothing working...
If u have some ideas...
Thx in advance.
PS : i know that DNS cant "redirect" the query, but it's to explain my goal.
Some links :
https://redirect.center
https://about.txtdirect.org/hosted/

Related

Gmail not recognizing MX record

I'm attempting to utilize SendGrid's inbound parse feature which parses any email sent to a specific subdomain and posts the data to an endpoint you provide.
This requires setting an MX record for your subdomain and pointing it at the SendGrid server.
I added the record in my DNS management and when I run dig mx it successfully shows the record
~ dig mx email.2x4game.com
; <<>> DiG 9.10.6 <<>> mx email.2x4game.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31172
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;email.2x4game.com. IN MX
;; ANSWER SECTION:
email.2x4game.com. 3600 IN MX 10 mx.sendgrid.net.
However, when I try to send an email to an address at the subdomain via Gmail, the email bounces and the error says
DNS Error: DNS type 'mx' lookup of email.2x4game.com responded with code NXDOMAIN Domain name not found: email.2x4game.com
Is there some additional step that I'm missing to be able to send emails to this subdomain?
The solution was to wait some time. After waiting 24+ hours, I am able to send emails to the subdomain and SendGrid is detecting them accordingly.

Problems setting up a mail server in a EC2 instance

I'm trying to setup my own mail server in an EC2 instance on AWS. I've installed the following image:
https://aws.amazon.com/marketplace/pp/B00K600RWK?ref=cns_srchrow
This image contains Webuzo: 2.2.9 + SquirrelMail:1.4.22. I followed all installation steps and the server is up and running ok. But whenever I try to login into an email account on SquirrelMail I get the following message:
"ERROR
Error connecting to IMAP server: ofaroldigital.com.br.
0 : php_network_getaddresses: getaddrinfo failed: No address associated with hostname"
Dig output:
$ dig ofaroldigital.com.br
; <<>> DiG 9.8.3-P1 <<>> ofaroldigital.com.br
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9193
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;ofaroldigital.com.br. IN A
;; AUTHORITY SECTION:
ofaroldigital.com.br. 173 IN SOA ns-1959.awsdns-52.co.uk. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
;; Query time: 24 msec
;; SERVER: 212.58.251.198#53(212.58.251.198)
;; WHEN: Tue Feb 2 10:58:37 2016
;; MSG SIZE rcvd: 125
I believe my route53 was configured correctly. What am I missing?
Thanks!
While ofaroldigital.com.br isn't resolving to anything, www.ofaroldigital.com.br is:
$ dig www.ofaroldigital.com.br +short
54.233.84.251
Have you made sure that you've added an A record for the Apex domain, that is to say, without the 'www' or any other subdomain?

Github Pages and Godaddy - CNAME error

I'm trying to use my Godaddy domain with github pages.
At this moment I've added the CNAME.md file with davidcafor.me
Created a A record to 192.30.252.153 and a CNAME www record to davidcafor.github.io.
But the problem is that davidcafor.me doesn't works.
What I'm doing wrong?
Your DNS records are correct:
; <<>> DiG 9.8.3-P1 <<>> a davidcafor.me
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31777
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;davidcafor.me. IN A
;; ANSWER SECTION:
davidcafor.me. 3600 IN A 192.30.252.153
The issue is that github.io is not configured to respond to that SNI. You will need to check with your settings in Github to make sure that domain is properly registered.
I believe the file needs to be named just CNAME, not CNAME.md. Or was it different in 2015?

Google Cloud DNS New zone

I create new zone to Google Cloud DNS, change domain registrants NS records to pointing ns-cloud-b1.googledomains.com, dig is showing correct information from authoritative NS but records doesn't appears on public DNS, is other configuration needed? or i must wait?
dig mydomain.com #ns-cloud-b4.googledomains.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> mydomain.com #ns-cloud-b4.googledomains.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12022
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
mydomain.com. IN A
;; ANSWER SECTION:
mydomain.com 300 IN A x.x.x.x
;; Query time: 176 msec
;; SERVER: 216.239.38.107#53(216.239.38.107)
;; WHEN: Thu Apr 23 21:49:38 2015
;; MSG SIZE rcvd: 40
You need to wait for the information to propagate throughout the Domain Name System. This depends on the time-to-live setting of each RRset. If you just created the zone and switched the nameservers in the registrar, you need to wait for the TTL of the nameserver records to expire - they are just records in the parent zone.
dig +trace mydomain.com should help to ensure that everything is set up properly.

Custom Domain Github Pages

So I've followed the directions for setting up a custom domain with Github Pages. As per their recommendation, I'm attempting to set this up using a custom subdomain.
I purchased my domain through GoDaddy, and using their DNS Manager tool I added myappname.github.io under Host (CNAME):
I didn't change anything else, such as that IP address under A (Host).
Lastly, on my Github page when I go under settings it correctly says "Your site is published under www.myappname.com"
Yet, when I go to www.myappname.com, I see the following:
What did I do wrong?
Edit:
Output from dig:
dig www.myappname.co
; <<>> DiG 9.8.3-P1 <<>> www.myappname.co
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19874
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.myappname.co. IN A
;; ANSWER SECTION:
www.myappname.co. 3600 IN CNAME myappname.github.io.
myappname.github.io. 3600 IN CNAME github.map.fastly.net.
github.map.fastly.net. 18 IN A 199.27.76.133
;; Query time: 198 msec
;; SERVER: 10.2.0.4#53(10.2.0.4)
;; WHEN: Tue Mar 17 11:08:00 2015
;; MSG SIZE rcvd: 120
Your DNS is configured to redirect the www subdomain to your GitHub Pages site, but your GitHub Pages CNAME file specifies that your application should run on the apex domain, myappname.com. This causes another redirection to the apex domain, which as you point out in your question has its own A record pointing to a non-GitHub IP address.
As we discussed, one possible solution is to update the CNAME file in your repository to use www.myappname.com instead of myappname.com and then set up a redirect from the apex domain to the www subdomain.
This will cause requests to myappname.github.io and myappname.com to redirect to www.myappname.com, where your site lives.