Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: start up with loopback dns configured - no route to host #247

Closed
adamsewell opened this issue Aug 22, 2021 · 12 comments
Closed

windows: start up with loopback dns configured - no route to host #247

adamsewell opened this issue Aug 22, 2021 · 12 comments
Labels
🐞 bug Something isn't working ❔ question Further information is requested 🤷 wontfix This will not be worked on
Milestone

Comments

@adamsewell
Copy link

adamsewell commented Aug 22, 2021

I'm using a test machine to play around with blocky, which the machine has 127.0.0.1 configured as the DNS server to use blocky. When starting blocky in this scenario, it is unable to download any of the feeds off the get go. I thought that maybe bootstrapDns would be the right setting to enable but it doesn't appear to help. Am I missing something or could blocky use the upstream resolvers to download the feeds on stat up? Thanks!

[2021-08-22 08:18:43]  INFO list_cache: starting download link=http://sysctl.org/cameleon/hosts
[2021-08-22 08:18:43]  INFO list_cache: starting download link=https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
[2021-08-22 08:18:43]  WARN list_cache: error during file processing: Get "http://sysctl.org/cameleon/hosts": dial tcp: lookup sysctl.org: no such host
[2021-08-22 08:18:43]  WARN list_cache: error during file processing: Get "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts": dial tcp: lookup raw.githubusercontent.com: no such host
[2021-08-22 08:18:43]  INFO list_cache: group import finished group=ads total_count=0
[2021-08-22 08:18:43]  INFO list_cache: starting download link=https://urlhaus.abuse.ch/downloads/hostfile/
[2021-08-22 08:18:43]  WARN list_cache: error during file processing: Get "https://urlhaus.abuse.ch/downloads/hostfile/": dial tcp: lookup urlhaus.abuse.ch: no such host
[2021-08-22 08:18:43]  INFO list_cache: group import finished group=phishing total_count=0

Current config:

upstream:
  default:
    - 1.0.0.1
    - 9.9.9.9
    - 94.140.14.14
blocking:
  blackLists:
    ads:
      - https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
      - http://sysctl.org/cameleon/hosts
      - https://block.energized.pro/basic/formats/hosts
    phishing:
      - https://urlhaus.abuse.ch/downloads/hostfile/
    porn:
      - https://block.energized.pro/porn/formats/hosts
  whiteLists:
    ads:
      - https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
  clientGroupsBlock:
    default:
      - ads
      - phishing
port: 53
httpPort: 4000
bootstrapDns: tcp+udp:8.8.4.4
@0xERR0R
Copy link
Owner

0xERR0R commented Aug 22, 2021

Your config looks good. "bootstrapDns" resolver should be used to resolve the addresses from the links. If you add logLevel: trace to you config, do you see "using 8.8.4.4:53 as bootstrap dns server"?

@adamsewell
Copy link
Author

adamsewell commented Aug 23, 2021

Yes, it's there. I should also mention this is on a Windows host.

[2021-08-22 20:50:34] DEBUG using 8.8.4.4:53 as bootstrap dns server
[2021-08-22 20:50:34]  INFO list_cache: starting download link=https://urlhaus.abuse.ch/downloads/hostfile/
[2021-08-22 20:50:34]  WARN list_cache: error during file processing: Get "https://urlhaus.abuse.ch/downloads/hostfile/": dial tcp: lookup urlhaus.abuse.ch: no such host
[2021-08-22 20:50:34]  INFO list_cache: group import finished group=phishing total_count=0
[2021-08-22 20:50:34]  INFO list_cache: starting download link=https://block.energized.pro/porn/formats/hosts
[2021-08-22 20:50:34]  WARN list_cache: error during file processing: Get "https://block.energized.pro/porn/formats/hosts": dial tcp: lookup block.energized.pro: no such host
[2021-08-22 20:50:34]  INFO list_cache: group import finished group=porn total_count=0
[2021-08-22 20:50:34]  INFO list_cache: starting download link=https://block.energized.pro/basic/formats/hosts
[2021-08-22 20:50:34]  INFO list_cache: starting download link=https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
[2021-08-22 20:50:34]  WARN list_cache: error during file processing: Get "https://block.energized.pro/basic/formats/hosts": dial tcp: lookup block.energized.pro: no such host
[2021-08-22 20:50:34]  INFO list_cache: starting download link=http://sysctl.org/cameleon/hosts
[2021-08-22 20:50:34]  WARN list_cache: error during file processing: Get "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts": dial tcp: lookup raw.githubusercontent.com: no such host
[2021-08-22 20:50:34]  WARN list_cache: error during file processing: Get "http://sysctl.org/cameleon/hosts": dial tcp: lookup sysctl.org: no such host
[2021-08-22 20:50:34]  INFO list_cache: group import finished group=ads total_count=0
[2021-08-22 20:50:34]  INFO list_cache: starting download link=https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
[2021-08-22 20:50:34]  WARN list_cache: error during file processing: Get "https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt": dial tcp: lookup raw.githubusercontent.com: no such host

@0xERR0R
Copy link
Owner

0xERR0R commented Aug 23, 2021

interesting, I have only linux machines to test. Is 8.8.4.4 reachable with nslookup (nslookup raw.githubusercontent.com 8.8.4.4)

@0xERR0R
Copy link
Owner

0xERR0R commented Aug 23, 2021

I'll try today on a Windows 10 VM, maybe this is only Windows problem

@adamsewell
Copy link
Author

That's what I'm testing on as well.

@0xERR0R
Copy link
Owner

0xERR0R commented Aug 23, 2021

blocky
I tried blocky 0.15 on windows 10 with your config, start was successful.

Maybe windows blocks some connections on your machine?

@0xERR0R 0xERR0R added the ❔ question Further information is requested label Aug 23, 2021
@adamsewell
Copy link
Author

adamsewell commented Aug 23, 2021

Well that is super odd. This is a fresh install of Windows 10 with nothing else installed, no AV, no well... anything installed. And you had set your DNS to manual config with 127.0.0.1 as the DNS server?

If I add a DNS server like 1.1.1.1 as the secondary it works as expected. I really seems like it's trying to default to the configured DNS rather than the bootstrap.

@0xERR0R
Copy link
Owner

0xERR0R commented Aug 23, 2021

No, I just started blocky and tried to perform a request against it with nslookup (nslookup google.com 127.0.0.1) and it worked. I'll try again with DNS configuraiton

@0xERR0R
Copy link
Owner

0xERR0R commented Aug 23, 2021

I tried again, it worked. After disabling of Ipv6 I could reproduce the behavior. Same error "no such host".

Tried on linux with reconfiguration of DNS server -> it works.

@0xERR0R 0xERR0R added the 🐞 bug Something isn't working label Aug 23, 2021
@adamsewell
Copy link
Author

Well that is super weird now, I just tried it again here at my office and it's working just fine with IPv6 enabled. I don't recall disabling IPv6 but it's possible I did.

I disabled IPv6 and sure enough, no route to host.

@0xERR0R
Copy link
Owner

0xERR0R commented Aug 24, 2021

It looks like golang uses under windows always the system resolver. There is an open proposal in golang which addresses this problem: golang/go#33097

As far I understand. it is not possible to use custom DNS resolver in go binaries in windows

@0xERR0R 0xERR0R changed the title start up with loopback dns configured - no route to host windows: start up with loopback dns configured - no route to host Aug 24, 2021
@0xERR0R 0xERR0R added this to the 0.16 milestone Aug 27, 2021
@0xERR0R
Copy link
Owner

0xERR0R commented Aug 27, 2021

Updated documentation, added a note that the bootstrapDns works only under Linux/*Nix OSes. Since this is a Go limitation, I'll close this issue and hope this will be fixed in near future by Go devs.

@0xERR0R 0xERR0R closed this as completed Aug 27, 2021
@0xERR0R 0xERR0R added the 🤷 wontfix This will not be worked on label Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ❔ question Further information is requested 🤷 wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants