We have an OSX host and an ubuntu 10.04 vagrant instance running on virtualbox. While attempting to send an email to emailtests.com (for email testing purposes) we noticed that the DNS was not resolving appropriately.
So we tried to following command on OSX and our Vagrant instance: dig -tMX emailtests.com
OSX
; <<>> DiG 9.8.3-P1 <<>> -tMX emailtests.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39364
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 3
;; QUESTION SECTION:
;emailtests.com. IN MX
;; ANSWER SECTION:
emailtests.com. 300 IN MX 10 litmus-smtp-in-392690123.us-east-1.elb.amazonaws.com.
;; AUTHORITY SECTION:
emailtests.com. 172711 IN NS ns-1596.awsdns-07.co.uk.
emailtests.com. 172711 IN NS ns-215.awsdns-26.com.
emailtests.com. 172711 IN NS ns-1288.awsdns-33.org.
emailtests.com. 172711 IN NS ns-964.awsdns-56.net.
;; ADDITIONAL SECTION:
ns-964.awsdns-56.net. 158810 IN A 205.251.195.196
ns-1288.awsdns-33.org. 158499 IN A 205.251.197.8
ns-1596.awsdns-07.co.uk. 72461 IN A 205.251.198.60
;; Query time: 74 msec
;; SERVER: 184.73.189.33#53(184.73.189.33)
;; WHEN: Mon Sep 9 13:15:02 2013
;; MSG SIZE rcvd: 282
Vagrant
; <<>> DiG 9.7.0-P1 <<>> -tMX emailtests.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2227
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;emailtests.com. IN MX
;; Query time: 104 msec
;; SERVER: 10.0.2.3#53(10.0.2.3)
;; WHEN: Mon Sep 9 13:09:42 2013
;; MSG SIZE rcvd: 32
As you can see the MX records are not resolving the same way. I looked around online and found answers telling us to add the following the vagrant file:
config.vm.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
config.vm.customize ["modifyvm", :id, "--natdnspassdomain1", "on"]
Which we already had. We are still not able to resolve that address and likely many other addresses properly. Any ideas about how to solve this or narrow down the problem?
Note: we are able to send email to gmail and can ping/dig some domains.
UPDATE, ifconfig from vagrant
eth0 Link encap:Ethernet HWaddr 08:00:27:36:71:5f
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe36:715f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38137 errors:0 dropped:0 overruns:0 frame:0
TX packets:26845 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:18987844 (18.9 MB) TX bytes:6605246 (6.6 MB)
eth1 Link encap:Ethernet HWaddr 08:00:27:80:07:aa
inet addr:192.168.42.3 Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe80:7aa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8294812 errors:0 dropped:0 overruns:0 frame:0
TX packets:4509692 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1871276346 (1.8 GB) TX bytes:1268188839 (1.2 GB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:815216 errors:0 dropped:0 overruns:0 frame:0
TX packets:815216 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:371105283 (371.1 MB) TX bytes:371105283 (371.1 MB)