简体   繁体   English

Scapy DNS请求在路由器后面

[英]Scapy dns request behind router

I am using Python/Scapy to send DNS requests. 我正在使用Python / Scapy发送DNS请求。 My computer's connection is set to use the gateway's DNS. 我的计算机的连接设置为使用网关的DNS。 My gateway is my router (Linksys LNK4500) at 192.168.1.1 and my router's connection is set up to use 8.8.8.8 as its DNS. 我的网关是位于192.168.1.1的路由器(Linksys LNK4500),并且路由器的连接设置为使用8.8.8.8作为其DNS。

If I use the destination that is the router's address, I get a correct response. 如果我使用的目的地是路由器的地址,则会得到正确的响应。

sr1(IP(dst="192.168.1.1")/UDP()/DNS(rd=1,qd=DNSQR(qname="www.cnn.com")))

However, if I want to use a different DNS server, for example Google's, and I try 但是,如果要使用其他DNS服务器(例如Google的DNS服务器),请尝试

sr1(IP(dst="8.8.8.8")/UDP()/DNS(rd=1,qd=DNSQR(qname="www.cnn.com")))

I get a response "WARNING: Mac address to reach destination not found. Using broadcast." 我收到响应"WARNING: Mac address to reach destination not found. Using broadcast." and then the packet is sent but I keep receiving packets forever with no answer. 然后发送数据包,但我一直无休止地接收数据包。

I don't think you should be using 8.8.8.8. 我认为您不应该使用8.8.8.8。 as IP.dst because first the packet should be directed to your router which in turn will send the packet to Google DNS server. 作为IP.dst,因为首先应将数据包定向到您的路由器,然后路由器会将数据包发送到Google DNS服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM