Trying to get this regex working.
[a-z0-9-\.]+(?!.in-addr.arpa*$)
sample -
sdfgsed.co.in //shall match
1.1.1.1.in-addr.arpa //shall not match
fgsagf.co.ru //shall match
agfasfdg21.cn //shall match
EDIT -
(?i)([a-z0-9-\.]{3,}\.(?!us|com|net)[a-z]{2})+$(?<!\.in-addr\.arpa)\x00
I tried the answer provided here. Regex to search in packets for DNS requests that are made for domain names expect .com .net. org TDLs. Any other domain name should match, and any reverse IP lookup request that ends with .in-addr.arpa
should not match. The name ends with hex value of NULL. And the name could be anywhere in the packet.
Search in packet payloads, Examples -
27.5.17.50.in-addr.arpa //reverse IP look up, shall not match
abcd.com // .com TDL shall not match
hacker.ru //shall match
badguy.com.cn //shall match