main.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package main
  15. import (
  16. "github.com/coredns/coredns/core/dnsserver"
  17. "github.com/coredns/coredns/coremain"
  18. _ "github.com/coredns/coredns/plugin/acl"
  19. _ "github.com/coredns/coredns/plugin/bind"
  20. _ "github.com/coredns/coredns/plugin/bufsize"
  21. _ "github.com/coredns/coredns/plugin/cache"
  22. _ "github.com/coredns/coredns/plugin/cancel"
  23. _ "github.com/coredns/coredns/plugin/chaos"
  24. _ "github.com/coredns/coredns/plugin/debug"
  25. _ "github.com/coredns/coredns/plugin/errors"
  26. _ "github.com/coredns/coredns/plugin/file"
  27. _ "github.com/coredns/coredns/plugin/forward"
  28. _ "github.com/coredns/coredns/plugin/health"
  29. _ "github.com/coredns/coredns/plugin/hosts"
  30. _ "github.com/coredns/coredns/plugin/loadbalance"
  31. _ "github.com/coredns/coredns/plugin/local"
  32. _ "github.com/coredns/coredns/plugin/log"
  33. _ "github.com/coredns/coredns/plugin/loop"
  34. _ "github.com/coredns/coredns/plugin/metrics" // prometheus
  35. _ "github.com/coredns/coredns/plugin/nsid"
  36. _ "github.com/coredns/coredns/plugin/ready"
  37. _ "github.com/coredns/coredns/plugin/reload"
  38. _ "github.com/coredns/coredns/plugin/rewrite"
  39. _ "github.com/coredns/coredns/plugin/timeouts"
  40. _ "github.com/coredns/coredns/plugin/trace"
  41. _ "github.com/coredns/coredns/plugin/whoami"
  42. _ "github.com/mholt/caddy/startupshutdown"
  43. _ "yunion.io/x/onecloud/pkg/dns"
  44. "yunion.io/x/onecloud/pkg/util/atexit"
  45. )
  46. var directives = []string{
  47. "cancel",
  48. "timeouts",
  49. "reload",
  50. "nsid",
  51. "bufsize",
  52. "bind",
  53. "debug",
  54. "trace",
  55. "ready",
  56. "health",
  57. "prometheus",
  58. "errors",
  59. "log",
  60. "local",
  61. "chaos",
  62. "loadbalance",
  63. "cache",
  64. "rewrite",
  65. "acl",
  66. "yunion",
  67. "hosts",
  68. "file",
  69. "loop",
  70. "forward",
  71. "whoami",
  72. "startup",
  73. "shutdown",
  74. }
  75. func init() {
  76. dnsserver.Directives = directives
  77. }
  78. func main() {
  79. defer atexit.Handle()
  80. coremain.Run()
  81. }