DNS don't resolve

0

Hello, I meet a DNS resolve error: When I "dig @aws nameserver example.com", the DNS can be resolved, But when I "dig @1.1.1.1 example.com", the status is "NXDOMAIN".

Could you please help me to handle this?

Jack
asked 2 months ago163 views
1 Answer
2

My VPC CIDR is 10.0.0.0/16. so VPC DNS is 10.0.0.2. I've created an EC2 instance within the VPC and resolving works for both 1.1.1.1 and 10.0.0.2

$ dig @1.1.1.1 google.com

; <<>> DiG 9.16.42-RH <<>> @1.1.1.1 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35145
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             145     IN      A       172.253.122.139
google.com.             145     IN      A       172.253.122.113
google.com.             145     IN      A       172.253.122.101
google.com.             145     IN      A       172.253.122.138
google.com.             145     IN      A       172.253.122.102
google.com.             145     IN      A       172.253.122.100

;; Query time: 20 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Mar 05 09:34:14 UTC 2024
;; MSG SIZE  rcvd: 135



$ dig @10.0.0.2 google.com

; <<>> DiG 9.16.42-RH <<>> @10.0.0.2 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38126
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             172     IN      A       172.253.63.102
google.com.             172     IN      A       172.253.63.139
google.com.             172     IN      A       172.253.63.101
google.com.             172     IN      A       172.253.63.113
google.com.             172     IN      A       172.253.63.100
google.com.             172     IN      A       172.253.63.138

;; Query time: 0 msec
;; SERVER: 10.0.0.2#53(10.0.0.2)
;; WHEN: Tue Mar 05 09:36:43 UTC 2024
;; MSG SIZE  rcvd: 135

Make sure that 1.1.1.1 is not blocked anywhere on a firewall

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
Artem
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions