Thread: [Plugin] DNS Plugin
View Single Post
Old 03/05/2009, 07:46 AM   #1
Huge Clucker
Join Date: May 2006
Posts: 449
Reputation: 500
Default DNS Plugin

DNS Plugin

This plugin provides functionality for DNS lookups and reverse DNS lookups.

  • dns(const host[], extra = 0);
    • Resolves the hostname to an IP address

  • rdns(const ip[], extra = 0);
    • Resolves the IP address to a hostname

Note that extra is an optional argument that can pass an integer, such as a player ID, to the callbacks.

  • OnDNS(host[], ip[], extra);
    • Called upon DNS lookup

  • OnReverseDNS(ip[], host[], extra);
    • Called upon reverse DNS lookup

Stock Function
  • GetPlayerHost(playerid);
    • Wrapper for rdns that can obtain a player's hostname


Create a directory called "plugins" inside of the server directory if one does not already exist. Place the plugin file (dns.dll or inside of this directory.

Add the following line to server.cfg so that the plugin will load the next time the server starts:

plugins dns.dll
On Windows, add to the pawno\include folder. Include this file in any of the scripts the server is running:

pawn Code:
#include <dns>

Recompile the scripts with any desired natives and callbacks provided by the include file. Start the server.


The latest compiled binaries will always be here:

GitHub Releases Page

The source can be browsed here. This repository can also be cloned.

The Windows version requires the Microsoft Visual C++ 2010 Redistributable Package.

Last edited by Incognito; 31/01/2016 at 10:45 PM.
Incognito is offline   Reply With Quote