Windows向けのクイックスタート

Windows向けのクイックスタートガイド。

Windowsを使用している場合は、これは開発用クイックスタートガイドです。

  1. 次の作業を必ず行なってください。GOPATHを設定する

  2. corednsとすべての依存関係を複製します: go get github.com/coredns/coredns

  3. ソースに移動します: cd $ENV:GOPATH\src\github.com\coredns\coredns

  4. corednsをフォークします(ただし複製はしません)

  5. リポジトリを指すように起点のURLを更新します: git remote set-url origin https://github.com/USERNAME/coredns.git

  6. エディタを開きます: code .

  7. 「Corefile」という名前の新しいファイルを作成し、入力します

    # 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
    }
    
  8. 「example.org」ファイルを作成します

    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"
    
  9. VSCodeからcorednsを実行し、次でテストできます

    > 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
    
  10. github.com\coredns\corednsを独自のリポジトリであるかのように使用します。これはVSCodeでデバッグが機能するようにするために必要です。

  11. 次のアイテムをグローバル.gitignoreに追加することを検討してください

```
coredns.exe
Corefile
.vscode
debug
```

Jonathan Dickinson
公開: 、タグ付け: ドキュメント, クイック, スタートWindows、書式: 248語。