mirror of
https://github.com/itdoginfo/allow-domains.git
synced 2025-04-13 01:09:08 +00:00
Logic for match-subdomain=no
This commit is contained in:
parent
330578eced
commit
96d977354f
1 changed files with 3 additions and 1 deletions
|
@ -132,12 +132,14 @@ def mikrotik_fwd(src, out, single=None, remove={'google.com'}):
|
|||
if re.search(r'[^а-я\-]', tldextract.extract(line).domain):
|
||||
domains_single.add(tldextract.extract(line.rstrip()).fqdn)
|
||||
|
||||
domains = domains.union(domains_single)
|
||||
#domains = domains.union(domains_single)
|
||||
domains = sorted(domains)
|
||||
|
||||
with open(f'{out}-mikrotik-fwd.lst', 'w') as file:
|
||||
for name in domains:
|
||||
file.write(f'/ip dns static add name={name} type=FWD address-list=allow-domains match-subdomain=yes forward-to=localhost\n')
|
||||
for name in domains_single:
|
||||
file.write(f'/ip dns static add name={name} type=FWD address-list=allow-domains match-subdomain=no forward-to=localhost\n')
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Russia inside
|
||||
|
|
Loading…
Add table
Reference in a new issue