Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petarov/host2ip-api
HTTP API server that resolves hostname IP addresses
https://github.com/petarov/host2ip-api
host-to-ip hostname hostname-lookup hostname-resolver
Last synced: 4 days ago
JSON representation
HTTP API server that resolves hostname IP addresses
- Host: GitHub
- URL: https://github.com/petarov/host2ip-api
- Owner: petarov
- License: mit
- Created: 2023-02-16T19:40:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T20:50:26.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T01:02:12.259Z (9 months ago)
- Topics: host-to-ip, hostname, hostname-lookup, hostname-resolver
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# host2ip
A tiny HTTP API server that resolves hostname IP addresses
# API
List of available API calls:
- `/` - shows available junctions
- `/lookup/:name` - fetches a list of IP addresses for the specified FQDN or hostname# Usage
To start the service on `[::1]:7029` run:
go run main.go
The server is now accessible at `http://localhost:7029`.
Example query:
curl -s http://localhost:7029/lookup/google.bg | jq
```json
{
"addresses": [
"172.217.16.131",
"2a00:1450:4001:808::2003"
]
}
```When using a key via the `-apikey` parameter the query would look like:
curl -s http://localhost:7029/lookup/google.bg?key=YOUR_KEY | jq
# Run on Docker
To create and install a Docker image called `github.com/petarov/host2ip-api` run:
make build-docker
To run the container run:
make run-docker
# License
[MIT](LICENSE)