1 class Coredns < Formula
2 desc "DNS server that chains plugins"
3 homepage "https://coredns.io/"
4 url "https://github.com/coredns/coredns/archive/refs/tags/v1.12.0.tar.gz"
5 sha256 "71a585f7d41cd07a0839788bd3bb17bcc26501711c857eeae7cae2f1f654eeac"
7 head "https://github.com/coredns/coredns.git", branch: "master"
11 strategy :github_latest
15 sha256 cellar: :any_skip_relocation, arm64_sequoia: "47e98345265be947d8eb69e60109b0c5b535f692d43e4ec9b26d2a898fea5fa8"
16 sha256 cellar: :any_skip_relocation, arm64_sonoma: "6c2d80376e5c7ced1d827d68db8323403c3caf7779da4f68d294dfe218da4653"
17 sha256 cellar: :any_skip_relocation, arm64_ventura: "445eb9d1d7d1954be13d9d627ac524a281a2c395f19b48f88f3f6dc6739799c7"
18 sha256 cellar: :any_skip_relocation, sonoma: "416cba4b07cdd04de0fadab927cc1e37352d845e20790b60f6df33b45bf41f39"
19 sha256 cellar: :any_skip_relocation, ventura: "24f74e3e5580f6619ad9c570e607d7ae4ce2df25f084c04cbe43a194bfd3a5a1"
20 sha256 cellar: :any_skip_relocation, x86_64_linux: "49e825e0683e588c2aa18f28de5818412ea819d0e98319fa81e5fdf9d255d94f"
23 depends_on "go" => :build
26 depends_on "bind" => :test # for `dig`
35 run [opt_bin/"coredns", "-conf", etc/"coredns/Corefile"]
38 working_dir HOMEBREW_PREFIX
39 log_path var/"log/coredns.log"
40 error_log_path var/"log/coredns.log"
46 exec bin/"coredns", "-dns.port=#{port}"
49 output = shell_output("dig @127.0.0.1 -p #{port} example.com.")
50 assert_match(/example\.com\.\t\t0\tIN\tA\t127\.0\.0\.1\n/, output)