Skip to content
Snippets Groups Projects
Commit da77c7fc authored by Maximilian Wilhelm's avatar Maximilian Wilhelm
Browse files

Remove leading "bb." from PTR names.


  This might be done more elegant but a positiv regex didn't work as
  expected, to do it the easy way before doing it right.

Signed-off-by: default avatarMaximilian Wilhelm <max@rfc2324.org>
parent 3f9f218e
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,8 @@ class MsgHandler(SocketServer.BaseRequestHandler):
try:
addr = dns.reversename.from_address(ipaddr)
return re.sub("((.srv)?.infra)?.ffpb.", "", str(ffpb_resolver.query(addr, "PTR")[0]))
ptr = str(ffpb_resolver.query(addr, "PTR")[0])
return re.sub("^bb.", "", re.sub("((.srv)?.infra)?.ffpb.", "", ptr))
except dns.resolver.NXDOMAIN:
return ipaddr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment