/DNSAgent/Rule.cs

https://github.com/stackia/DNSAgent · C# · 47 lines · 17 code · 8 blank · 22 comment · 0 complexity · 74009be3db805f0d374be4c6b819afcd MD5 · raw file

  1. using System.Collections.Generic;
  2. using Newtonsoft.Json;
  3. namespace DnsAgent
  4. {
  5. internal class Rules : List<Rule> {}
  6. internal class Rule
  7. {
  8. /// <summary>
  9. /// Regex pattern to match the domain name.
  10. /// </summary>
  11. [JsonProperty(Required = Required.Always)]
  12. public string Pattern { get; set; } = "$^";
  13. /// <summary>
  14. /// IP Address for this domain name. IPv4 address will be returned as A record and IPv6 address as AAAA record.
  15. /// </summary>
  16. public string Address { get; set; } = null;
  17. /// <summary>
  18. /// The name server used to query about this domain name. If "Address" is set, this will be ignored.
  19. /// </summary>
  20. public string NameServer { get; set; } = null;
  21. /// <summary>
  22. /// Whether to use DNSPod HttpDNS protocol to query the name server for this domain name.
  23. /// </summary>
  24. public bool? UseHttpQuery { get; set; } = null;
  25. /// <summary>
  26. /// Timeout for the query, in milliseconds. This overrides options.cfg. If "Address" is set, this will be ignored.
  27. /// </summary>
  28. public int? QueryTimeout { get; set; } = null;
  29. /// <summary>
  30. /// Whether to transform request to AAAA type.
  31. /// </summary>
  32. public bool? ForceAAAA { get; set; } = null;
  33. /// <summary>
  34. /// Whether to enable compression pointer mutation to query this name server. If "Address" is set, this will be
  35. /// ignored.
  36. /// </summary>
  37. public bool? CompressionMutation { get; set; } = null;
  38. }
  39. }