This is a development quick start guide when you are using Windows.
-
Make sure that you have your GOPATH set up
-
Clone coredns and all dependencies:
go get github.com/coredns/coredns
-
Navigate to the source:
cd $ENV:GOPATH\src\github.com\coredns\coredns
-
Fork (but not clone) coredns
-
Update the origin to point at your repository:
git remote set-url origin https://github.com/USERNAME/coredns.git
-
Open your editor:
code .
-
Create a new file named
Corefile
and populate it:# Only port 53 is supported as NSLOOKUP no longer supports non-standard ports .:53 { # Your router proxy . 192.168.1.1:53 file D:\dev\zone\example.org example.org errors log }
-
Create the
example.org
file:example.org. IN SOA dns.example.org. domains.example.org. ( 2012062701 ; serial 300 ; refresh 1800 ; retry 14400 ; expire 300 ) ; minimum @ IN NS dns.example.com. @ 42000 IN A 127.0.0.1 @ 42000 IN A 127.0.0.2 @ 42000 IN A 127.0.0.3 api 42000 IN CNAME sample.service.dns.example.de. www 42000 IN CNAME sample.service.dns.example.de. blog 42000 IN CNAME sample.service.dns.example.de. @ 3600 IN MX 1 ASPMX1.L.google.com. @ 3600 IN MX 1 ASPMX2.L.google.com. @ 3600 IN MX 1 ASPMX3.L.google.com. @ 300 IN TXT "v=spf1 include:_spf.google.com ~all"
-
You should be able to execute coredns from VSCode, test it with:
> nslookup - localhost Default Server: UnKnown Address: ::1 > example.org Server: UnKnown Address: ::1 Name: example.org Addresses: 127.0.0.1 127.0.0.2 127.0.0.3
-
Use
github.com\coredns\coredns
as though it were your own repository. This is required to ensure that debugging works in VSCode. -
You might want to add the following to your global
.gitignore
:
```
coredns.exe
Corefile
.vscode
debug
```