Skip to content

Commit

Permalink
Update httpdns.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasen committed Sep 17, 2015
1 parent 486be92 commit 9e44d42
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions public/services/httpdns.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# 心动 httpdns 服务接口文档
### 心动 httpdns 服务接口文档

本接口可以查询特定域名对应的IP地址。

## APIs
#### APIs

| 端口 | 协议 | 请求 | 返回 |
| ------ | ------ | ------ | ------ |
| 1053 | http | http://httpdns.xdapp.com:1053/dns?d={$domain} | 字符串,该域名的ip地址 |
| 1153 | tcp | tcp://httpdns.xdapp.com:1153 字符串类型,$domain + "\\n" | 字符串,该域名的ip地址 |


## 通过 IP 调用
#### 通过 IP 调用

使用 54.223.165.195 代替域名 httpdns.xdapp.com

## 测试 http 接口
#### 测试 http 接口
```bash
curl "http://httpdns.xdapp.com:1053/dns?d=tomasen.org"
```

`curl "http://httpdns.xdapp.com:1053/dns?d=tomasen.org"`
#### 测试 tcp 接口
```bash
printf "tomasen.org\n" | nc httpdns.xdapp.com 1153
```

## 测试 tcp 接口

`printf "tomasen.org\n" | nc httpdns.xdapp.com 1153`

-
_如需自行部署可以参考 [项目源代码](https://github.com/tomasen/httpdns)_

0 comments on commit 9e44d42

Please sign in to comment.