- when I tested it today, it worked properly; so there is some other variable involved that may clear up with time.
- i rebooted the machine and the problem returned, and both exec and the ping (as requested) fail for the hostname "serial4.tool.irs", but "e-serial4.tool.irs" is happy.
- the following transcript ofthe failures is from after the reboot (I also tested the hostname "e-serial.tool.irs" in the script and it works properly, then re-tested "serial4.tool.irs" and it still failed):
**********
Alpha:status eowyn$ ping e-serial4.tool.irs
PING e-serial4.tool.irs (10.0.5.184): 56 data bytes
64 bytes from 10.0.5.184: icmp_seq=0 ttl=64 time=0.346 ms
64 bytes from 10.0.5.184: icmp_seq=1 ttl=64 time=0.381 ms
64 bytes from 10.0.5.184: icmp_seq=2 ttl=64 time=0.352 ms
64 bytes from 10.0.5.184: icmp_seq=3 ttl=64 time=0.564 ms
^C
--- e-serial4.tool.irs ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.346/0.411/0.564/0.089 ms
Alpha:status eowyn$ ping serial4.tool.irs
ping: cannot resolve serial4.tool.irs: Unknown host
Alpha:status eowyn$
Alpha:status eowyn$ dig +short e-serial4.tool.irs
10.0.5.184
Alpha:status eowyn$ dig +short serial4.tool.irs
10.0.5.184
Alpha:status eowyn$ ping serial4.tool.irs
ping: cannot resolve serial4.tool.irs: Unknown host
Alpha:status eowyn$ ping serial4.tool.irs.
ping: cannot resolve serial4.tool.irs.: Unknown host
Alpha:status eowyn$ ./dnstest.sh
10.0.5.184 = serial4.tool.irs.
OK 10.0.5.184
./dnstest.sh: line 11: serial4.tool.irs.: nodename nor servname provided, or not known
./dnstest.sh: line 11: /dev/tcp/serial4.tool.irs./10001: Invalid argument
BAD serial4.tool.irs.
****** dnstest.sh ******
#!/bin/sh
DEST2="serial4.tool.irs."
DEST1=`dig +short "$DEST2"`
echo "$DEST1 = $DEST2 "
if exec 3<> "/dev/tcp/$DEST1/10001"; then
echo "OK $DEST1 "
exec 3>&-
else
echo "BAD $DEST1 "
fi
if exec 3<> "/dev/tcp/$DEST2/10001"; then
echo "OK $DEST2 "
exec 3>&-
else
echo "BAD $DEST2 "
fi
exit