詳解地址git
$go get github.com/coreos/etcd
$cd ~/etcd
$./bin/etcd (還有一些參數能夠隨etcd啓動,後面詳解)
$go get -u github.com/skynetservices/skydns
$cd $GOPATH/src/github.com/skynetservices/skydns
$go build -v
$curl -XPUT http://127.0.0.1:4001/v2/keys/skydns/config \
-d value='{"dns_addr":"127.0.0.1:53","ttl":3600, "nameservers": ["8.8.8.8:53","8.8.4.4:53"]}'
$./skydns (還有一些參數能夠隨skydns啓動,後面詳解)
$curl -XPUT http://127.0.0.1:4001/v2/keys/skydns/local/skydns/wtf/wtf1 \
-d value='{
"host":"192.168.0.1",
"port":12345,
"priority":20,
"weight":100,
"text":"it is a info for this machine",
"ttl":3600,
"targetstrip":1,
"group":"g1"
}'
$nslookup wtf1.wtf.skydns.local
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: wtf1.wtf.skydns.local
Address: 192.168.0.1
至此表示skydns能夠正常解析手動存進etcd中域名信息