0

I have a machine on EC2 which has an elastic IP assigned to it. I ran the following command on it to listen to udp port 53

nc -u -l 53

I then ran from a local machine (not on ec2):

nslookup blah.com <elastic ip address>

For some reason this actually resolves the ip address, and nothing appears in the output of netcat. If I run nslookup on the ec2 instance itself and specify localhost as the dns server, then it works as I would expect (you can see the requested domain in the output of netcat).

I have configured a security group to allow external access to the machine via udp port 53.

Does anyone know why this doesn't work the way I expect?

6
  • Just tried changing the port to 54 and it works the way I would expect
    – Slicedpan
    Jun 7, 2016 at 13:33
  • Does it work if you aren't running the nc?
    – ConnorJC
    Jun 7, 2016 at 19:57
  • nc running or not makes no difference, the dns request will always resolve, despite the fact that the machine can't resolve it!
    – Slicedpan
    Jun 8, 2016 at 12:39
  • Is it possible for you to post the elastic IP to help with debugging? Also, what is the output of sudo nestat -tulpn?
    – ConnorJC
    Jun 8, 2016 at 23:01
  • relevant line from netstat: udp 0 0 0.0.0.0:53 0.0.0.0:* 12059/nc
    – Slicedpan
    Jun 9, 2016 at 9:42

0

You must log in to answer this question.

Browse other questions tagged .