[Plugin] DNS Plugin
#21

check your inbox @ sa-mp forum
Reply
#22

For those who have a windows server and get this error and the plugin is inside the plugins folder

Код:
Loading plugin: dns.dll
Failed.

Script[gamemodes|filterscripts/x.amx]: Run time error 19: "File or function is not found"
download this new compiled dns.dll by Incognito.

download
Reply
#23

If someone has a Dynamic IP and that IP changes,
does his hostname changes too?

Reply
#24

Quote:
Originally Posted by watkijkje
If someone has a Dynamic IP and that IP changes,
does his hostname changes too?
no, it will resolve the same hostname unless you use a proxy or change internet provider
Reply
#25

To expand slightly on that: yes, in that case, the entire hostname will change, but the top-level hostname label (i.e., the part that designates the ISP) will not. For example, if your hostname is 127-0-0-1.my.isp.com, but your IP address changes while you are still on the same ISP, then the last part (my.isp.com) will stay the same.

Over the past few days, I have worked with Contador to resolve compatibility issues with the plugin. It should work fine now on Windows and most Linux distributions. Please inform me if there are any problems.
Reply
#26

Quote:
Originally Posted by Kye
I wanted to make a comment about this.

Reverse DNS is obviously very useful if you need to ban players on a hostmask say: *.their-isp.com. You could check the host off on connect and Kick() them. But:

Reverse DNS takes time to resolve and it's the duty of an SA-MP script to return execution to the server as quickly as possible. Calling this function will likely delay execution and result in lag for other players while the reverse DNS lookup is occuring. The only way to do this properly is for the DNS lookup to be threaded and call a callback like OnPlayerReverseDNS(playerid, rdns_string[]).

Doesn't it cause problems if you have a different thread call functions in the AMX?
Reply
#27

I would like to note one final update (hopefully): I have resolved segmentation faults in Linux by executing callbacks from the main thread. The only way I could figure out how to do this was to create a new function, dns_poll_events, which must now be called on a timer somewhere in the script. Look at my updated banhost.pwn for an example.
Reply
#28

Quote:
Originally Posted by Incognito
I would like to note one final update (hopefully): I have resolved segmentation faults in Linux by executing callbacks from the main thread. The only way I could figure out how to do this was to create a new function, dns_poll_events, which must now be called on a timer somewhere in the script. Look at my updated banhost.pwn for an example.
This is the only way i have found to make things completely thread safe using a plugin, a polling scheme that polls plugin for updates. I guess you did this for windows also?
Reply
#29

Hi, nice plugin.
But i need a Command like that: /banhost [playerid]
I have try it but it doesn't works.

- LJ
Reply
#30

mmmm use it aver that this is nice and tanks for job
Reply
#31

How are you suppose to do the banhost. I tried it and I can't figure it out can I have a example?
Reply
#32

Quote:
Originally Posted by BP13
Посмотреть сообщение
How are you suppose to do the banhost. I tried it and I can't figure it out can I have a example?
You have to parse the output. It is period (or fullstop for you brits) separated so parse(sscanf) it by that. The problem is host name formats are non-standard so your best bet is banning by domain name by getting whats on the left and right of the last period.
Reply
#33

Could you add another parameter to OnDNS and OnReverseDNS to tell if the lookup was successful? It really need it
Reply
#34

Quote:
Originally Posted by TheInnocentOne
Посмотреть сообщение
Could you add another parameter to OnDNS and OnReverseDNS to tell if the lookup was successful? It really need it
Compare IP vs. Host in the callbacks. If they match, the lookup failed.

pawn Код:
if(!strcmp(ip,host))
{
 //failed
}
else
{
 //succeeded
}
Reply
#35

Hello, I'm not sure what else a script needs to have in it for GetPlayerHost(playerid) to return the hostname.

I have dns.dll in the plugins folder and have it in server.cfg, and #include <dns> at the top, and it compiles fine. Maybe I'm missing something because I don't understand what it means to "add the plugin's natives and callbacks".

Edit: I added this and it's triggered after it does GetPlayerHost(playerid):

Код:
public OnReverseDNS(ip[], host[], extra)
{
	new msg[128];
	format(msg, sizeof(msg), "Your hostname is %s.", host);
	SendClientMessage(extra, COLOR_RED, msg);

	return 1;
}
So I was able to do what I needed to by having it do GetPlayerHost(playerid) when they connect, and storing the result when OnReverseDNS is triggered. Now I'm just wondering if it's still possible for GetPlayerHost to return the hostname like in the example.
Reply
#36

Awesome plugin.
Reply
#37

i do not understand..

why not used with:

GetPlayerIP(playerid); ?
Reply
#38

who that has used this plugin has some host to add to the list banned_host?
Reply
#39

Quote:
Originally Posted by EviLpRo
Посмотреть сообщение
i do not understand..

why not used with:

GetPlayerIP(playerid); ?
This gets the host I guess. Try tracing your ip and see what host do you have, and then you'll understand what is this used for.
Reply
#40

Quote:
Originally Posted by Kalcor
Посмотреть сообщение
I wanted to make a comment about this.

Reverse DNS is obviously very useful if you need to ban players on a hostmask say: *.their-isp.com. You could check the host off on connect and Kick() them. But:

Reverse DNS takes time to resolve and it's the duty of an SA-MP script to return execution to the server as quickly as possible. Calling this function will likely delay execution and result in lag for other players while the reverse DNS lookup is occuring. The only way to do this properly is for the DNS lookup to be threaded and call a callback like OnPlayerReverseDNS(playerid, rdns_string[]).
I think this can only ban the whole ISP, or ban one player like Ban(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)