PtokaX forum

Development Section => Your Developing Problems => Topic started by: kepp on 10 November, 2003, 18:13:43

Title: Ban DNS?
Post by: kepp on 10 November, 2003, 18:13:43
You can get The DNS from a user with tohostname(user.sIP)

But is it possible to ban the DNS?
Title:
Post by: SaintSinner on 10 November, 2003, 19:29:17
why would you want to ban a entire DNS  ?(
you would be banning 1000's possibly
hundreds of thousands of users
too dangerous im figuring. ;)
Title:
Post by: c h i l l a on 10 November, 2003, 19:53:47
kepp

something like

if strfind(tohostname(ip), "THE DNS") then
   -- do what you want
end

or get the ip range with whois and ban the ip range with the logger
Title:
Post by: kepp on 10 November, 2003, 20:06:24
thanks alot :)

SainSinner: As far as i know, if you ban the persons DNS
it will only ban him,
I've ever seen anyone with the same DNS, Which is good with dynamic IP's and if you really want to ban the person for good.
Title:
Post by: c h i l l a on 10 November, 2003, 20:11:38
well kepp one thing, if you only wanna ban one single dns then its no good, ban the ip cause if the ip changes the hostname changes too, you can either ban the ip, if he has dynamic ip then its no use, then I would ban the ip range, if you realy want to get rid of him, or enter a string in THE DNS that is always the same in on these ip's.

something like

strfind(tohostname(ip), "dorm.utexas.edu")

would get all users from that host.
Title:
Post by: kepp on 10 November, 2003, 20:21:24
Ok  :S

I have a dynamic ip adress but my dns stays the same.
Which is why i thought it would be a great idea..

But thanks :) I've learned something new

While im on it, im going to ask another question as i don't want to start a new thread everytime.

I want to TimeBan(time) a user.
and im thinking about making a command such as
?timeban
Title:
Post by: c h i l l a on 10 November, 2003, 20:24:59
sure your dns domain name server  stays the same,

he is a server of your provider...   with most likely a static IP address.

but the hostname  of a users dynamic ip  will change when the ip changes.
Title:
Post by: kepp on 10 November, 2003, 21:23:51
^^
Title:
Post by: kepp on 10 November, 2003, 21:30:14
i tried with this

s,e,cmd,name,timer = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(%D+)%d+(.+)%d+(%D+)")

time = timer

victim:TimeBan(time)
Title:
Post by: tezlo on 11 November, 2003, 10:43:14
1. the code above doesnt make any sense
2. not all IPs can be resolved so tohostname() will return nil occasionally
Title:
Post by: kepp on 11 November, 2003, 15:01:08
I noticed to and ended up with this code :

elseif (cmd=="+timeban") or (cmd=="?timeban") then
s,e,cmd,Name,reason,time = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s*(.+)%s+(.*).*")
rsn = reason
timer = time
if victim ~= nil then
SendToAll(BotName, user.sName.." Banned "..victim.sName..", Reason: "..rsn.." For: "..timer.." Minutes")
victim:SendPM(BotName, "You have been Banned by: "..user.sName..", Reason: "..rsn.." For: "..timer.." Minutes")
victim:TimeBan(timer) return 1