2016-07-30 06:32:48 +08:00
|
|
|
DNS Client Application
|
|
|
|
|
2016-08-05 00:21:34 +08:00
|
|
|
|
2016-07-30 06:32:48 +08:00
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
|
|
|
* Ethernet LAN for testing purposes.
|
|
|
|
|
|
|
|
* Galileo Gen 2 Development Board.
|
|
|
|
|
|
|
|
* USB-UART cable: CH340, FTDI 6-pin or equivalent for debugging.
|
|
|
|
|
|
|
|
* dnsmasq application. The dnsmasq version used in this sample is:
|
|
|
|
|
2016-08-05 00:21:34 +08:00
|
|
|
dnsmasq -v
|
|
|
|
Dnsmasq version 2.75 Copyright (c) 2000-2015 Simon Kelley
|
|
|
|
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
Building instructions
|
|
|
|
---------------------
|
|
|
|
|
2016-09-09 14:14:23 +08:00
|
|
|
* Read src/tcp_config.h, change the IP addresses according to the LAN
|
2016-07-30 06:32:48 +08:00
|
|
|
environment.
|
|
|
|
|
|
|
|
* make pristine && make are enough to build this sample.
|
|
|
|
|
|
|
|
* Follow the steps indicated here:
|
|
|
|
|
|
|
|
https://www.zephyrproject.org/doc/board/galileo.html
|
|
|
|
|
|
|
|
to load the binary into the Galileo Dev Board.
|
|
|
|
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
* Open a terminal window and type:
|
|
|
|
|
2016-08-05 00:21:34 +08:00
|
|
|
dnsmasq -d
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
* Connect the USB-UART cable to the Galileo. Open a terminal and run:
|
|
|
|
|
2016-08-05 00:21:34 +08:00
|
|
|
screen /dev/ttyUSB0 115200
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
* Connect Galileo to the LAN, Turn on the board.
|
|
|
|
|
|
|
|
* The screen terminal window will show:
|
|
|
|
|
|
|
|
-----------------------------------------
|
|
|
|
Domain name: not_a_real_domain_name
|
2016-08-05 00:21:34 +08:00
|
|
|
[fiber:89] DNS Query: OK, ID: 0
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
|
|
|
[fiber:102] DNS Response: ERROR <- :)
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
-----------------------------------------
|
2016-08-05 00:21:34 +08:00
|
|
|
Domain name: linuxfoundation.org
|
|
|
|
[fiber:89] DNS Query: OK, ID: 1
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
|
|
|
|
|
|
|
****** DNS ANSWER: 0 ******
|
|
|
|
Response: IP address Size: 4: 140 211 169 4
|
|
|
|
|
|
|
|
[fiber:102] DNS Response: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
-----------------------------------------
|
2016-08-05 00:21:34 +08:00
|
|
|
Domain name: www.linuxfoundation.org
|
|
|
|
[fiber:89] DNS Query: OK, ID: 2
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
****** DNS ANSWER: 0 ******
|
2016-08-05 00:21:34 +08:00
|
|
|
Response: IP address Size: 4: 140 211 169 4
|
|
|
|
|
|
|
|
[fiber:102] DNS Response: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
-----------------------------------------
|
2016-08-05 00:21:34 +08:00
|
|
|
Domain name: gnu.org
|
|
|
|
[fiber:89] DNS Query: OK, ID: 3
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
****** DNS ANSWER: 0 ******
|
2016-08-05 00:21:34 +08:00
|
|
|
Response: IP address Size: 4: 208 118 235 148
|
|
|
|
|
|
|
|
[fiber:102] DNS Response: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
-----------------------------------------
|
2016-08-05 00:21:34 +08:00
|
|
|
Domain name: www.gnu.org
|
|
|
|
[fiber:89] DNS Query: OK, ID: 4
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
****** DNS ANSWER: 0 ******
|
2016-08-05 00:21:34 +08:00
|
|
|
Response: CNAME NO IP address
|
|
|
|
CNAME: wildebeest.gnu.org
|
|
|
|
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
****** DNS ANSWER: 1 ******
|
2016-08-05 00:21:34 +08:00
|
|
|
Response: IP address Size: 4: 208 118 235 148
|
2016-07-30 06:32:48 +08:00
|
|
|
|
2016-08-05 00:21:34 +08:00
|
|
|
[fiber:102] DNS Response: OK
|
|
|
|
|
|
|
|
-----------------------------------------
|
|
|
|
Domain name: npr.org
|
|
|
|
[fiber:89] DNS Query: OK, ID: 5
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
|
|
|
|
|
|
|
****** DNS ANSWER: 0 ******
|
|
|
|
Response: IP address Size: 4: 216 35 221 76
|
|
|
|
|
|
|
|
[fiber:102] DNS Response: OK
|
2016-07-30 06:32:48 +08:00
|
|
|
|
|
|
|
-----------------------------------------
|
2016-08-05 00:21:34 +08:00
|
|
|
Domain name: www.npr.org
|
|
|
|
[fiber:89] DNS Query: OK, ID: 6
|
|
|
|
[fiber:92] TX: OK
|
|
|
|
[fiber:97] RX: OK
|
|
|
|
|
|
|
|
****** DNS ANSWER: 0 ******
|
|
|
|
Response: CNAME NO IP address
|
|
|
|
CNAME: www-cdn.npr.org.edgesuite.net
|
|
|
|
|
|
|
|
|
|
|
|
****** DNS ANSWER: 1 ******
|
|
|
|
Response: CNAME NO IP address
|
|
|
|
CNAME: a1723.g.akamai.net
|
|
|
|
|
|
|
|
|
|
|
|
****** DNS ANSWER: 2 ******
|
|
|
|
Response: IP address Size: 4: 63 80 4 192
|
|
|
|
|
|
|
|
|
|
|
|
****** DNS ANSWER: 3 ******
|
|
|
|
Response: IP address Size: 4: 63 80 4 161
|
|
|
|
|
|
|
|
[fiber:102] DNS Response: OK
|