direct.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. export interface DNSMapping {
  2. hosts: {
  3. [domain: string]: string[]
  4. },
  5. /** which also disallows wildcard */
  6. realip: boolean,
  7. /** should convert to ruleset */
  8. ruleset: boolean,
  9. dns: string,
  10. /**
  11. * domain[0]
  12. *
  13. * + subdomain only
  14. * $ domain only exact match
  15. * [none] domain and subdomain
  16. */
  17. domains: string[]
  18. }
  19. export const DIRECTS = {
  20. HOTSPOT_CAPTIVE_PORTAL: {
  21. dns: 'system',
  22. hosts: {},
  23. realip: false,
  24. ruleset: false,
  25. domains: [
  26. 'securelogin.com.cn',
  27. '$captive.apple.com',
  28. '$hotspot.cslwifi.com'
  29. ]
  30. },
  31. SYSTEM: {
  32. dns: 'system',
  33. hosts: {},
  34. realip: true,
  35. ruleset: false,
  36. domains: [
  37. '+m2m',
  38. // '+ts.net', // TailScale Magic DNS
  39. // AdGuard
  40. '$injections.adguard.org',
  41. '$local.adguard.org',
  42. // Auto Discovery
  43. '+bogon'
  44. ]
  45. }
  46. } as const satisfies Record<string, DNSMapping>;
  47. export const LAN = {
  48. ROUTER: {
  49. dns: 'system',
  50. hosts: {},
  51. realip: false,
  52. ruleset: true,
  53. domains: [
  54. '+home',
  55. // 'zte.home', // ZTE CPE
  56. // 'airbox.home',
  57. // 'bthub.home',
  58. // 'bthomehub.home',
  59. // 'hitronhub.home',
  60. // 'web.setup.home'
  61. // Aruba Router
  62. '$instant.arubanetworks.com',
  63. '$setmeup.arubanetworks.com',
  64. // ASUS router
  65. '$router.asus.com',
  66. '$repeater.asus.com',
  67. 'asusrouter.com',
  68. // NetGear
  69. 'routerlogin.net',
  70. 'routerlogin.com',
  71. // Tenda WiFi
  72. // 'tendawifi.com',
  73. // TP-Link Router
  74. 'tplinkwifi.net',
  75. 'tplogin.cn',
  76. 'tplinkap.net',
  77. 'tplinkmodem.net',
  78. 'tplinkplclogin.net',
  79. 'tplinkrepeater.net',
  80. // UniFi
  81. '+ui.direct',
  82. '$unifi',
  83. // Other Router
  84. // '$router.com',
  85. '+huaweimobilewifi.com',
  86. '+router',
  87. // 'my.router',
  88. // 'samsung.router',
  89. // '$easy.box', // Vodafone EasyBox
  90. '$aterm.me',
  91. '$console.gl-inet.com',
  92. // '$fritz.box',
  93. // '$fritz.repeater',
  94. // '$myfritz.box',
  95. // '$speedport.ip', // Telekom
  96. // '$giga.cube', // Vodafone GigaCube
  97. '$homerouter.cpe', // Huawei LTE CPE
  98. '$mobile.hotspot', // T-Mobile Hotspot
  99. '$ntt.setup',
  100. '$pi.hole',
  101. '+plex.direct'
  102. // 'web.setup'
  103. ]
  104. },
  105. LAN: {
  106. dns: 'system',
  107. hosts: {
  108. // localhost: ['127.0.0.1']
  109. },
  110. realip: true,
  111. ruleset: true,
  112. domains: [
  113. '+lan',
  114. // 'amplifi.lan',
  115. // '$localhost',
  116. '+localdomain',
  117. 'home.arpa',
  118. // AS112
  119. '10.in-addr.arpa',
  120. '16.172.in-addr.arpa',
  121. '17.172.in-addr.arpa',
  122. '18.172.in-addr.arpa',
  123. '19.172.in-addr.arpa',
  124. // '2?.172.in-addr.arpa',
  125. '20.172.in-addr.arpa',
  126. '21.172.in-addr.arpa',
  127. '22.172.in-addr.arpa',
  128. '23.172.in-addr.arpa',
  129. '24.172.in-addr.arpa',
  130. '25.172.in-addr.arpa',
  131. '26.172.in-addr.arpa',
  132. '27.172.in-addr.arpa',
  133. '28.172.in-addr.arpa',
  134. '29.172.in-addr.arpa',
  135. '30.172.in-addr.arpa',
  136. '31.172.in-addr.arpa',
  137. '168.192.in-addr.arpa',
  138. '254.169.in-addr.arpa'
  139. ]
  140. }
  141. } as const satisfies Record<string, DNSMapping>;
  142. export const HOSTS = {
  143. HOSTS: {
  144. // not actually used, only for a placeholder
  145. dns: 'quic://dns.alidns.com:853',
  146. hosts: {
  147. 'cdn.jsdelivr.net': ['cdn.jsdelivr.net.cdn.cloudflare.net']
  148. },
  149. realip: false,
  150. ruleset: false,
  151. domains: []
  152. }
  153. } as const satisfies Record<string, DNSMapping>;