That's because it's doing a reverse DNS lookup -
getting a domain name from an IP address. The reverse DNS
is obtained from the DNS server that is authoritative for
the given network block. For example, if you were assigned
203.145.67.0/24, your domain was mudjunkie.org, your
workstation's IP address was 203.145.67.23 and you had
setup a DNS A RR of ima.mudjunkie.org, the name that would
be returned would be the PTR RR for 203.145.67.23. If
you have a full /24 assigned to you, your ISP will probably
be kind enough to assign PTR records for your IP block,
but if you've got a little /29+ then odds are you're stuck
with whatever they've dynamically assigned to you.
The other option, if you are running your own
system, is to setup a local DNS server, either on the same
system or on another system on your network and put its
IP into the /etc/resolv.conf file of the MUD server like so:
nameserver 203.145.67.23
Make sure it's towards the top of the list of
DNS servers.
Now, add the following to your named.conf file
on the DNS server:
zone "67.145.203.in-addr.arpa" IN {
type master;
file "zones/67.145.203.in-addr.arpa";
allow-update { none; };
};
This configures BIND to answer requests for
the 203.145.67.0/24 network from the zone file
$dns_root/zones/67.145.203.in-addr.arpa. You'll need
to setup that file, like so:
$ORIGIN .
$TTL 3600 ; 1 hour
67.145.203.in-addr.arpa IN SOA localhost. postmaster.localhost. (
2004030800 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
3600 ; minimum (1 hour)
)
IN NS dnshost.yourdomain.com.
$ORIGIN 67.145.203.in-addr.arpa.
1 IN PTR onehost.mudjunkie.org.
23 IN PTR workstation.mudjunkie.org.
25 IN PTR mudserver.mudjunkie.org.
Now, any requests for 203.145.67.23 will
resolve to workstation.mudjunkie.org.
Ryan
--
HELO, my name is root... you have SIGKILLed my father... prepare to vi!
On Tue, 2004-03-02 at 07:03, Richard Lindsey wrote:
> No clue... Haven't heard of those 2 functions so I'm not sure what they
> do :) and I just try to man them on my server but there were no entries
> for them... I only know of gethostbyname because one of our imps on
> another mud I work on has a domain name, but it never shows that he's
> from that domain in our sockets list, it's always his dynamically
> assigned host name from his ISP, so he wanted me to set something up
> where it would do a check on his registered domain name to see what it
> resolved to, then do a check on his host name that the mud was seeing,
> and if they matched, substitute his domain name in his h_name data, so
> that's how I got to learn all that wonderful stuff :D