0

I am trying to test IP Address of DNS with port number 53 using DIG as follows

**dig +notcp 172.217.10.78 -p 53**

i am getting as output as follows

; <<>> DiG 9.16.10 <<>> +notcp 172.217.10.78 -p 53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 1253
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 2911ec9f75e970fa4d8549f86019214e8b430d779c4cf8aa (good)
;; QUESTION SECTION:
;172.217.10.78.                 IN      A

;; AUTHORITY SECTION:
.                       10800   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2021020200 1800 900 604800 86400

;; Query time: 272 msec
;; SERVER: 10.77.138.254#53(10.77.138.254)
;; WHEN: Tue Feb 02 15:24:22 India Standard Time 2021
;; MSG SIZE  rcvd: 145 

but works fine with Domain Name like below

**dig +notcp google.com -p 53**

Output as follows

; <<>> DiG 9.16.10 <<>> +notcp google.com -p 53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63772
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 858252e82bc5204340ae41b76019219f1767e2863966ca7c (good)
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             215     IN      A       172.217.10.78

;; Query time: 116 msec
;; SERVER: 10.77.138.254#53(10.77.138.254)
;; WHEN: Tue Feb 02 15:25:43 India Standard Time 2021
;; MSG SIZE  rcvd: 83

Why it is not working with IP Address? Same output expected with IP Address as well for UDP and TCP testing. Since I am new for this, I am not understanding properly where went wrong. An early response would be appreciated

My exact requirement is Need to test TCP and UDP connections separately. Basically needs to have a report of test connections like TCP and UDP communication happening or not.

Manu N
  • 31
  • 3

1 Answers1

0

It is clear from the site that The -b option sets the source IP address of the query to address. This must be a valid address on one of the host's network interfaces. You can try with -b option ie. dig -b <IP Address>.

For more details, refer below the links.

https://linux.die.net/man/1/dig

https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html

Sambit
  • 7,625
  • 7
  • 34
  • 65