[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get ip from server



On 4/19/2003 at 11:39 PM Richard Fuchs wrote:

>there are situations where you don't want to use the hostname that the 
>irc server gives you, most notably when you're behind a linux nat/masq 
>box which has the irc-nat module loaded and you don't have the option of 
>forwarding specific ports on the firewall. 

I'm not sure I see how the local machine's non-routable address of 10.0.1.3 or
192.168.1.1 or whatever is going to be preferable.  If you're behind NAT
you're potentially going to have problems either way for things like
initiating DCC.

>also, some irc servers tend 
>to give you invalid information about your own hostname. for example, 
>when whoising yourself, you'd see a faked hostname in the reply, which 
>doesn't resolve to an ip and so it is useless for ip detection.

I presume you're referring to things like +x (host masking).  With all due
respect, if you're getting bogus data back from the server in that regard, the
IRCD you're using is broken.  The address you get from the IRCD should be
valid and not masked.  Further, when you /whois yourself, you should get your
own valid IP or symbolic address; others receive only a masked version.

For example, if I were +x under Unreal, for myself I would see:

James is ~escape@ascends-250B54E4.tnt1.richmond.va.da.uu.net * James LiGate
James is connecting from *@1Cust236.tnt1.richmond.va.da.uu.net
James on #test 
James using hurricane.va.us.ascends.net Hold Onto Your Hats
James has been idle 14secs, signed on Sun Apr 20 18:51:14
James End of /WHOIS list.

The first line is what everyone sees.  The second line comes to the connection
owner (and IRCOps+) only.  Also, local addressing under the same circumstances
returns "Local host: black (10.0.1.3)" on connect (10.0.1.3 is my local
nonroutable address); nabbing the data from the server returns "Local host:
1Cust236.tnt1.richmond.va.da.uu.net (67.201.152.236)" -- which you will note
is correct and non-masked.

The data above was pasted directly from a live session (not from X-Chat; I'm
not emailing from my Linux box at the moment).

Offhand, the only time I can think of that you WOULDN'T want to fetch the
information from the server is when reverse-DNS isn't resolving and you needed
the IP address for DCC... and even then, the local option would only be useful
if you weren't running NAT.

I agree with Nehal that getting the address from the server is a reasonable
default, on the presumption that a lot of folks aren't really up on the finer
points of IRC and DCC.

Cheers,
James


--
XChat-discuss: mailing list for XChat users
Archive:       http://mail.nl.linux.org/xchat-discuss/