title: Android DNS MX record lookup
body: <p>I want to lookup dns mx records an the android platform.
  When using <a href="http://www.dnsjava.org" rel="nofollow">http://www.dnsjava.org</a> on android  <code>new Lookup("gmail.com", Type.MX).run();</code> always returns null.</p>
  
  <pre><code>    import org.xbill.DNS.Lookup;
      import org.xbill.DNS.MXRecord;
      import org.xbill.DNS.Record;
      import org.xbill.DNS.TextParseException;
      import org.xbill.DNS.Type;
  
  
  List&lt;String&gt; targets = new ArrayList&lt;String&gt;();
  Record[] records;  
  
      records = new Lookup("gmail.com", Type.MX).run();
  
      for (int i = 0; i &lt; records.length; i++) {
       MXRecord mx = (MXRecord) records[i];
       targets.add("Host " + mx.getTarget() + " has preference  "+ mx.getPriority());
      }
  </code></pre>
  
  <p>Any ideas or alternatives?
  Thanks!</p>