NSStream sockets with bad reverse DNS
NSStream sockets with bad reverse DNS
- Subject: NSStream sockets with bad reverse DNS
- From: Samuel Tesla <email@hidden>
- Date: Wed, 8 Jun 2005 00:09:44 -0500
Hey all,
I ran across a very interesting problem with NSStream.
When I create an NSHost object, it appears to do its best to fill
both the address and the names out. If I create it using and IP, it
will do reverse DNS lookups. The interesting problem comes up when I
create an NSHost from an IP address, but the hostname that reverse
DNS finds is not a good one. In that case it gets errors when it
tries to get the streams.
I've attached the program I used to generate the following output.
Here's a perfectly good host:
$ host 155.53.1.242
242.1.53.155.in-addr.arpa domain name pointer veal.babymeat.com.
$ host veal.babymeat.com
veal.babymeat.com has address 155.53.1.242
$ ./testnshost 155.53.1.242 7777
2005-06-07 23:51:48.215 testnshost[21836] Testing: 155.53.1.242 7777
2005-06-07 23:51:48.422 testnshost[21836] NSStreamEventOpenCompleted
2005-06-07 23:51:48.423 testnshost[21836] NSStreamEventOpenCompleted
2005-06-07 23:51:48.423 testnshost[21836] NSStreamEventHasSpaceAvailable
2005-06-07 23:51:48.543 testnshost[21836] NSStreamEventHasBytesAvailable
Here's a bad host:
$ host 212.13.197.5
5.197.13.212.in-addr.arpa domain name pointer sneaky.geekstuff.co.uk.
$ host sneaky.geekstuff.co.uk.
Host sneaky.geekstuff.co.uk not found: 3(NXDOMAIN)
$ ./testnshost 212.13.197.5 7773
2005-06-07 23:52:06.032 testnshost[21838] Testing: 212.13.197.5 7773
2005-06-07 23:52:06.051 testnshost[21838] NSStreamEventErrorOccurred:
Error NSUnknownErrorDomain 7
2005-06-07 23:52:06.053 testnshost[21838] NSStreamEventErrorOccurred:
Error NSUnknownErrorDomain 7
Anybody have an idea about this? It seems that NSStream is using
[host name] instead of [host address]...but that seems odd.
Thanks,
Samuel
Attachment:
testnshost.m
Description: Binary data
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden