For giggles, I reinstalled this test machine from scratch again. Practice makes perfect.
I kept everything simple, selecting default options etc. I selected 'yes' for ipv6 setup and DCHP. I left domain blank this time, and set hostname to 'bsddesktop'. I updated the kernel, but skipped pf config and openntpd for now (no real fear, it's a throw-away install and I'm behind a router). Xorg/Xfce/Opera etc installed through 'pkg_add -r'.
Ok. This is the new info (I'm still 192.168.0.192, router is still 192.168.0.1) ...
Code:
[mart@bsddesktop /usr/home/mart]$ uname -a
FreeBSD bsddesktop 7.0-RELEASE-p6 FreeBSD 7.0-RELEASE-p6 #0: Mon Nov 24 06:43:33 UTC 2008 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
[mart@bsddesktop /usr/home/mart]$ sockstat -4
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
root Xorg 934 3 tcp4 *:6000 *:*
root syslogd 716 7 udp4 *:514 *:*
[mart@bsddesktop /usr/home/mart]$ hostname
bsddesktop
[mart@bsddesktop /usr/home/mart]$ cat /etc/hosts
# comments snipped for brevity...
::1 localhost localhost.my.domain
127.0.0.1 localhost localhost.my.domain
[mart@bsddesktop /usr/home/mart]$ cat /etc/resolv.conf
search MYISPNAME.net
nameserver 192.168.0.1
With this, sendmail initialization at login failed forever. The reason it's missing from sockstat is that I had to ctrl-c to actually login.
Code:
[mart@bsddesktop /usr/home/mart]$ ping bsddesktop
ping: cannot resolve bsddesktop: Host name lookup failure
Ok, so I assume the correct solution is to add it hosts.
Code:
[mart@bsddesktop /usr/home/mart]$ cat /etc/hosts
# comments snipped for brevity...
::1 localhost localhost.my.domain
127.0.0.1 localhost localhost.my.domain
127.0.0.1 bsddesktop
[mart@bsddesktop /usr/home/mart]$ ping bsddesktop
PING bsddesktop (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.054 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.029 ms
...
Reboot to see if this resolves the sendmail issue... Nope, but at least we eventually time-out now, with a different result - 'My unqualified host name (bsddesktop) unknown; sleeping for retry'.
Code:
[mart@bsddesktop /usr/home/mart]$ cat /var/log/maillog
Dec 4 16:47:47 bsddesktop newsyslog[657]: logfile first created
Dec 4 16:48:48 bsddesktop sm-mta[790]: gethostbyaddr(192.168.0.192) failed: 2
Dec 4 16:48:48 bsddesktop sm-mta[791]: starting daemon (8.14.2): SMTP+queueing@00:30:00
Dec 4 16:49:33 bsddesktop sm-msp-queue[795]: starting daemon (8.14.2): queueing@00:30:00
Dec 4 16:58:16 bsddesktop sm-mta[797]: gethostbyaddr(192.168.0.192) failed: 2
Dec 4 16:58:16 bsddesktop sm-mta[798]: starting daemon (8.14.2): SMTP+queueing@00:30:00
Dec 4 16:59:01 bsddesktop sm-msp-queue[802]: starting daemon (8.14.2): queueing@00:30:00
Dec 4 17:28:48 bsddesktop sm-mta[817]: My unqualified host name (bsddesktop) unknown; sleeping for retry
Dec 4 17:36:53 bsddesktop sm-mta[830]: My unqualified host name (bsddesktop) unknown; sleeping for retry
So, with the default install it failed on 'gethostbyaddress'. Understandable, I guess. After adding my hostname to /etc/hosts we get a long timeout, followed by 'unqualified host name; sleeping for retry'. Which is semi-understandable. I don't have a qualifed hostname to give it, just what this machine is known as on the local network, i.e. my hostname. That's as far as I've gotten with sendmail, but wanted to capture the info before I go blindly changing things.
Now, back to the main issue - AAAA DNS woes. Remember this is a default install, unmodified kernel (i.e. with ipv6)...
Here's a log of DNS traffic, trying to go to 'www.itv-f1.com' from within Opera, deperately trying to find out why Honda are leaving F1...
Code:
[mart@bsddesktop /usr/home/mart]$ sudo tcpdump -i sk0 port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on sk0, link-type EN10MB (Ethernet), capture size 96 bytes
18:30:46.891332 IP 192.168.0.192.51563 > 192.168.0.1.domain: 50324+ AAAA? www.itv-f1.com. (32)
18:30:47.082641 IP 192.168.0.1.domain > 192.168.0.192.51563: 50324 0/1/0 (95)
18:30:47.083064 IP 192.168.0.192.50071 > 192.168.0.1.domain: 50325+ AAAA? www.itv-f1.com.MYISPNAME.net. (45)
18:30:47.134871 IP 192.168.0.192.58585 > 192.168.0.1.domain: 39899+ PTR? 1.0.168.192.in-addr.arpa. (42)
18:30:52.082367 IP 192.168.0.192.64824 > 192.168.0.1.domain: 50325+ AAAA? www.itv-f1.com.MYISPNAME.net. (45)
18:30:52.135242 IP 192.168.0.192.58585 > 192.168.0.1.domain: 39899+ PTR? 1.0.168.192.in-addr.arpa. (42)
18:31:02.082368 IP 192.168.0.192.53352 > 192.168.0.1.domain: 50325+ AAAA? www.itv-f1.com.MYISPNAME.net. (45)
18:31:02.136393 IP 192.168.0.192.60036 > 192.168.0.1.domain: 39900+ PTR? 192.0.168.192.in-addr.arpa. (44)
18:31:07.137264 IP 192.168.0.192.60036 > 192.168.0.1.domain: 39900+ PTR? 192.0.168.192.in-addr.arpa. (44)
18:31:08.082647 IP 192.168.0.1.domain > 192.168.0.192.50071: 50325 NXDomain 0/1/0 (96)
18:31:08.134669 IP 192.168.0.1.domain > 192.168.0.192.58585: 39899 NXDomain* 0/1/0 (105)
18:31:22.083323 IP 192.168.0.192.52809 > 192.168.0.1.domain: 50325+ AAAA? www.itv-f1.com.MYISPNAME.net. (45)
18:31:23.135471 IP 192.168.0.1.domain > 192.168.0.192.60036: 39900 NXDomain* 0/1/0 (107)
18:31:43.083113 IP 192.168.0.1.domain > 192.168.0.192.52809: 50325 NXDomain 0/1/0 (96)
18:31:43.083521 IP 192.168.0.192.52350 > 192.168.0.1.domain: 50326+ A? www.itv-f1.com. (32)
18:31:43.302093 IP 192.168.0.1.domain > 192.168.0.192.52350: 50326 1/2/0 A 83.98.74.146 (98)
18:31:44.138457 IP 192.168.0.192.60690 > 192.168.0.1.domain: 39901+ PTR? 146.74.98.83.in-addr.arpa. (43)
18:31:44.248550 IP 192.168.0.192.59758 > 192.168.0.1.domain: 50327+ AAAA? www.itv.com. (29)
18:31:44.408492 IP 192.168.0.1.domain > 192.168.0.192.59758: 50327 2/1/0 CNAME[|domain]
18:31:44.408745 IP 192.168.0.192.60731 > 192.168.0.1.domain: 50328+ A? www.itv.com. (29)
18:31:44.413778 IP 192.168.0.1.domain > 192.168.0.192.60731: 50328 4/9/0 CNAME[|domain]
... SNIP ...
18:33:56.850337 IP 192.168.0.192.63654 > 192.168.0.1.domain: 50356+ A? pix04.revsci.net. (34)
18:33:57.005251 IP 192.168.0.1.domain > 192.168.0.192.63654: 50356 2/4/0 CNAME[|domain]
^C
92 packets captured
2162 packets received by filter
0 packets dropped by kernel
Ugh, an epic 3mins to load the main page. The AAAA requests take an age, but after they've failed, the A requests fill quickly as expected. The 1st request alone takes a full minute. The 'websitename.myispname.net' requests look really odd to my uneducated eye, as in 'I couldn't find AAAA websitename, so trying the searchpath listed in resolv.conf, i.e 'websitename.MYISPNAME.net'. Which seems about as wrong as can be, but that's what is set up from a default install. I'm pretty sure that If I bypass DHCP like in my 1st install (where resolv.conf had 'domain local'), it would have been asking for 'websitename.local' through my router->ISP - i.e. equally wrong).
So. It seems like I have two distinct issues, that are both 'fixed' by removing ipv6 from the kernel. I'm sure this is all rather obvious to the network-savvy, but I can't explain why. That bugs me, and goes against the very reason I arrived at the BSDs in the first place
I'm going to go learn how to decipher the tcpdump report correctly now (rather than assuming), but if anyone has any insights in the meantime I'd love to hear them...