Commit Graph
273 Commits
Author SHA1 Message Date
LoyalsoldierandGitHub a783cd5f08 DNS: refine code (#1193) 2021-08-10 11:08:05 +08:00
73470e8dd8 DNS: fix typo & refine code (#1183)
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2021-08-10 10:49:56 +08:00
朱聖黎andGitHub 8fed55f69f Fix: routing rule not applied for TCP DNS (#1144) 2021-07-16 15:13:58 +08:00
Shelikhoo 1409be04c2 regenerate protobuf files 2021-07-01 18:58:48 +01:00
Shelikhoo cf3688729e show explicit error to users with a incorrect fake DNS setting. 2021-06-28 16:59:50 +01:00
Shelikhoo 9a03b425c9 apply coding style 2021-06-22 12:56:35 +01:00
f84a401704 Feat: DNS transport over TCP (#983)
* feat: DNS over TCP

* fix: DNS over TCP misbehaving

* fix: add a blank line after +build tag

* style: rename NewTCPLNameServer to NewTCPLocalNameServer

* style: add some comments

* style: format

Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
2021-06-04 20:09:06 +01:00
LoyalsoldierandGitHub 6f8979d017 Style: format code by gofumpt (#1022) 2021-05-20 05:28:52 +08:00
LoyalsoldierandGitHub 411a50c8fa Fix: multi FakeDNS Close method (#956) 2021-05-01 22:20:33 +08:00
LoyalsoldierandGitHub 0d4479a72a Fix: FakeDNS prints error with empty config (#955) 2021-05-01 21:44:12 +08:00
LoyalsoldierandGitHub 625a15e03b Chore: format code by new customized goimports (#950) 2021-05-01 11:15:39 +08:00
Shelikhoo dbfc2138e4 fix: make sure the ctx is propagated to connections by detached connection for udp dns 2021-04-28 16:44:01 +01:00
Shelikhoo d48cf1a648 fix: make sure the ctx is propagated to connections by detached connection 2021-04-28 16:29:19 +01:00
Shelikhoo 2e26cf6587 fix: make sure the ctx is propagated to connections 2021-04-28 15:43:43 +01:00
sixg0000dandGitHub bad6cdfb88 Fix: fakedns return ErrEmptyResponse without result (#926) 2021-04-22 08:12:05 +08:00
Shelikhoo 8ba4ac15ac fixed a panic issue caused by not checking type of input address in fake dns 2021-04-18 23:45:51 +01:00
Shelikhoo d7c9a98d76 apply coding style 2021-04-13 16:06:48 +01:00
Shelikhoo 1e282944a6 apply coding style 2021-04-13 15:39:10 +01:00
Shelikhoo f5d2ddedb4 Merge branch 'dev-fakednsimprovement' 2021-04-13 15:14:47 +01:00
LoyalsoldierandGitHub 47bbb5a3de Fix: DNS hosts proxied domain priority (#886) 2021-04-11 11:52:12 +08:00
LoyalsoldierandGitHub bada0e48b4 Feat: DNS hosts support multiple addresses (#884) 2021-04-10 21:56:08 +08:00
Shelikhoo 7e82418a40 make fake dns aware of resolution IP proto requirement in fake dns server 2021-04-09 23:19:06 +01:00
Shelikhoo c6064452f0 added new API to support fakedns + other sniffer and IPv4 IPv6 dual stack fake dns 2021-04-09 23:15:20 +01:00
LoyalsoldierandGitHub 108a700e85 Fix: fakedns option (#879) 2021-04-09 15:02:42 +01:00
LoyalsoldierandGitHub 3f40089caf Feat: add disableFallback & skipFallback option for DNS (#864) 2021-04-09 10:35:26 +08:00
LoyalsoldierandGitHub f3a56ca090 Feat: update lucas-clemente/quic-go to v0.20.0 (#816) 2021-03-22 22:26:30 +08:00
LoyalsoldierandGitHub 86a6d15028 Fix: DNS tests timeout due to network instability (#805) 2021-03-20 19:27:09 +08:00
LoyalsoldierandGitHub e6aaa57def Feat: add queryStrategy option for DNS (#794) 2021-03-19 15:55:18 +08:00
LoyalsoldierandGitHub 9e9173acb4 Chore: update protobuf & dependencies (#793)
* Chore: update protobuf
* Chore: regenerate mock files
* Chore: update dependencies
* Chore: use Go v1.16.2 and later
2021-03-18 12:17:26 +08:00
LoyalsoldierandGitHub 933861a761 FakeDNS: use 198.18.0.0/15 as default IP pool (#779) 2021-03-15 16:47:10 +08:00
LoyalsoldierandGitHub e03947e6b0 Chore: update protobuf & dependencies (#748) 2021-03-08 05:12:27 +08:00
Shelikhoo 8cf51a847e fix misbehaving code crash and create bug on transport level front proxy 2021-03-06 13:53:25 +00:00
LoyalsoldierandGitHub 49cf614346 Chore: update dependencies & protobuf (#728) 2021-03-03 17:31:53 +08:00
LoyalsoldierandGitHub 45740be4af Fix panic: index out of range (#727) 2021-03-03 16:53:42 +08:00
LoyalsoldierandGitHub 9d13f99633 Chore: format file & change names of test cases (#707) 2021-02-24 17:12:44 +08:00
7ebf3afc31 Feat: add disableCache option for DNS (#705)
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2021-02-24 16:03:50 +08:00
afb8385a7e Feat: routing and freedom outbound ignore Fake DNS (#696)
Turn off fake DNS for request sent from Routing and Freedom outbound.
Fake DNS now only apply to DNS outbound.
This is important for Android, where VPN service take over all system DNS
traffic and pass it to core.  "UseIp" option can be used in Freedom outbound
to avoid getting fake IP and fail connection.

Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2021-02-23 10:17:20 +08:00
LoyalsoldierandGitHub f94dd11a8c Chore: change module name (#677) 2021-02-17 04:31:50 +08:00
LoyalsoldierandGitHub f98944c9e0 Chore: update protobuf (#670) 2021-02-11 14:57:20 +08:00
38da831b75 Feature: Fake DNS support (#406)
* Add fake dns

A new config object "fake" in DnsObject for toggling fake dns function

Compare with sniffing, fake dns is not limited to http and tls traffic.
It works across all inbounds. For example, when dns request come
from one inbound, the local DNS server of v2ray will response with a
unique fake IP for every unique domain name. Then later on v2ray
received a request to one of the fake IP from any inbounds, it will
override the request destination with the previously saved domain.

By default, v2ray cache up to 65535 addresses. The old records will
be discarded bases on LRU. The fake IP will be 240.x.x.x

* fix an edge case when encounter a fake IP in use

* Move lru to common.cache package

* Added the necessary change to obtain request IP from sniffer

* Refactor the code so that it may stop depending on global variables in the future.

* Replace string manipulation code with more generic codes, hopefully this will work for both IPv4 and IPv6 networks.

* Try to use IPv4 version of address if possible

* Added Test Case for Fake Dns

* Added More Test Case for Fake Dns

* Stop user from creating a instance with LRU size more than subnet size, it will create a infinite loop

* Move Fake DNS to a separate package

* Generated Code for fakedns

* Encapsulate Fake DNS as a Instance wide service

* Added Support for metadata sniffer, which will be used for Fake DNS

* Dependency injection for fake dns

* Fake DNS As a Sniffer

* Remove stub object

* Remove global variable

* Update generated protobuf file for metadata only sniffing

* Apply Fake DNS config to session

* Loading for fake dns settings

* Bug fix

* Include fake dns in all

* Fix FakeDns Lint Condition

* Fix sniffer config

* Fix lint message

* Fix dependency resolution

* Fix fake dns not loaded as sniffer

* reduce ttl for fake dns

* Apply Coding Style

* Apply Coding Style

* Apply Coding Style

* Apply Coding Style

* Apply Coding Style

* Fix crashed when no fake dns

* Apply Coding Style

* Fix Fake DNS do not apply to UDP socket

* Fixed a bug prevent FakeDNS App Setting from become effective

* Fixed a caveat prevent FakeDNS App Setting from become effective

* Use log comparison to reduce in issue when it comes to really high value typical for ipv6 subnet

* Add build tag for fakedns

* Removal of FakeDNS specific logic at DNS client: making it a standard dns client

* Regenerate auto generated file

* Amended version of configure file

* Bug fixes for fakeDNS

* Bug fixes for fakeDNS

* Fix test: remove reference to removed attribute

* Test: fix codacy issue

* Conf: Remove old field support

* Test: fix codacy issue

* Change test scale for TestFakeDnsHolderCreateMappingAndRollOver

* Test: fix codacy issue

Co-authored-by: yuhan6665 <1588741+yuhan6665@users.noreply.github.com>
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: kslr <kslrwang@gmail.com>
2021-02-08 18:18:52 +08:00
V2Fly TeamandGitHub 66e203f156 DNS: refine skipRoutePick (#558) 2020-12-30 18:35:19 +08:00
maskedekenandGitHub 8c5b392f27 DNS: add DNS over QUIC support (#534) 2020-12-25 19:13:50 +08:00
LoyalsoldierandGitHub c27ed16e6a Fix: DNS compatible with localhost nameserver (#530) 2020-12-19 12:17:55 +08:00
d8c03f10b5 Refactoring: DNS App (#169)
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2020-12-18 17:24:33 +08:00
LoyalsoldierandGitHub d9db22093b Fix: write to log without clientIP (#517) 2020-12-15 16:59:23 +08:00
LoyalsoldierandGitHub 166d1afee5 DNS: add clientip for specific nameserver (#504) 2020-12-12 07:15:29 +08:00
loyalsoldier 784775f689 Refine code according to golangci-lint results 2020-10-11 19:22:46 +08:00
LoyalsoldierandGitHub 807922f883 Reduce timeout & fix ineffassign (#290) 2020-10-09 16:32:12 +08:00
LoyalsoldierandGitHub 454528353d Fix misspelling according to goreportcard result (#282) 2020-10-08 08:53:15 +08:00
LoyalsoldierandGitHub bb44d01096 Format proto files using clang-format according to google style (#264)
* Format proto files using clang-format according to google style
* Regenerate pb.go files
2020-10-05 08:36:40 +08:00