Giter Site home page Giter Site logo

nickns's Introduction

NickNS

NickNS is DNS Server. This server resolve VM Name into IP Address on VMware ESXi.

Versions

  • Go 1.17 or later

Installation

Download binary file from here.

wget

On Linux:

wget https://github.com/cdsl-research/nickns/releases/latest/download/release-lin64.zip
unzip release-lin64.zip

curl

On Linux:

curl -o release-lin64.zip https://github.com/cdsl-research/nickns/releases/latest/download/release-lin64.zip
unzip release-lin64.zip

go get

go install github.com/cdsl-research/nickns

Usage

[0] Enable SSH on ESXi

Generate SSH Key on laptop.

ssh-keygen -t rsa -b 4096

Copy SSH key from from laptop to ESXi.

$ sftp [email protected]
Connected to [email protected].
sftp> puts /path/to/id_rsa.pub /etc/ssh/keys-root/authorized_keys

Try to connect SSH on Terminal.

ssh -i /path/to/id_rsa [email protected]

See also: https://kb.vmware.com/s/article/1002866

[1] Edit Config files

Set ESXi Host on hosts.toml.

[host A]
address = "esxi.example.com"
port = "22"
user = "root"
identity_file = "/path/to/id_rsa"

[host B]
address = "esxi.example.com"
port = "22"
user = "root"
password = "my_password"

Set NickNS running options on config.toml.

port = 5310
domains = ["local.", "example.com."]
ttl = 3600

[2] start server

$ nickns
2020/03/14 21:40:25 NickNS Starting at 5310/udp
2020/03/14 21:40:27 [QueryHit] elastic5.local. => 192.168.0.36
2020/03/14 21:40:30 [QueryHit] elastic5.example.com. => 192.168.0.36

The command supports config options as follows.

-c string
      Path to config.toml (default "config.toml")
-n string
      Path to hosts.toml (default "hosts.toml")

Development

Build local ssh server

docker build -t ssh .
docker run -it -p 2200:22 ssh

Run DNS Server

go run main.go

Check DNS server

# Type A
$ dig A +short @127.0.0.1 -p 5300 unbound.local
192.168.0.35
$ dig A +short @127.0.0.1 -p 5300 unbound.local
192.168.0.35

# Type PTR
$ dig +short @127.0.0.1 -p 5300 -x 192.168.0.35
unbound.local.

Server Log

2020/02/29 18:47:25 Starting at 5300
2020/02/29 18:47:38 [QueryHit] unbound.local. => 192.168.0.35
2020/02/29 18:47:41 [CacheHit] unbound.local.
2020/02/29 18:47:42 [QueryHit] unbound.local. => 192.168.0.35
2020/02/29 18:47:52 [QueryHit] 35.0.168.192.in-addr.arpa. => unbound.local.

nickns's People

Contributors

tomoyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tomoyk

nickns's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.