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

DNS Plugin

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

Natives
  • 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.

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

Instructions

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

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

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

Code:
#include <dns>

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

Download

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