From: Yves-Eric Date: 2009-02-23T11:29:29+09:00 Subject: DNS MX lookup issue: local machine returned as MX for an non-existant domain! Hi all, Trying to do some email domain validation, I am facing a weird issue when looking up an MX entry. Here is a three-liner test code: require 'resolv' domain = "i-dont-exist-iutjdfuyoxfugy.com" Resolv::DNS.open { |dns| dns.getresources(domain, Resolv::DNS::Resource::IN::MX)} On my development machine, this returns an empty list, as expected (the domain does not exist, it cannot have an MX record!). However, in my production environment, the same code returns: => [#, @preference=10>] It returns the production machine itself as a valid MX for a domain that does not exist! I double-checked on the command line that "nslookup -q=mx i-dont-exist- iutjdfuyoxfugy.com" indeed returns NXDOMAIN... Could someone please explain to me why this may be happening, and how to fix it? Howcome Resolv::DNS is returning an MX record for a domain that does not exist?! As a temporary workaround, I am simply filtering out mydomain.com from the MX list, but it really bugs me not knowing what the root of the problem is. Thank you, -- Yves-Eric