From: Brian Candler Date: 2009-03-02T17:53:53+09:00 Subject: Re: DNS MX lookup issue: local machine returned as MX for an non-existant domain! Yves-Eric wrote: > Problem solved. Executive summary: it is a documentation bug. DNS > name queries need a final dot. I disagree. DNS queries in normal use should *not* need a trailing dot, and indeed in E-mail addresses the final dot is forbidden. If your system is appending a default domain, then it should be doing so according to an explicit configuration. In the case of nslookup / dig (libbind), this configuration is in /etc/resolv.conf If Resolv::DNS is making up its own default domains from some other source, e.g. by hacking up your system hostname and guessing the domain from that, that's a bug in my opinion. A quick source scan suggests this is exactly what's happening, and the offending code is here: hostname = Socket.gethostname if /\./ =~ hostname @search = [Label.split($')] else @search = [[]] end However looking at the source also suggests you can fix this problem by setting :search=>[] as an argument to Resolv::DNS.new > Where should I fill a bug report? redmine.ruby-lang.org I'd argue it's a case of dangerous defaults - but it may be rejected on the grounds that users (who know what they are doing) can override the default. > For the record, I > also learned that "[|proto]" means that the packet was truncated at > the "proto" protocol level Oh yes, sorry I forgot that. My prototypical use: tcpdump -ieth0 -s0 -nX ... Regards, Brian. -- Posted via http://www.ruby-forum.com/.