# Dnsclient Library

**URL:** <https://community.particle.io/t/dnsclient-library/41921>\
**Category:** Firmware\
**Created:** [May 20, 2018, 2:41am UTC](https://community.particle.io/t/dnsclient-library/41921 "2018-05-20T02:41:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [May 20, 2018, 2:41am UTC](https://community.particle.io/t/dnsclient-library/41921/1 "2018-05-20T02:41:20Z")

</div>

I have an application where I need to send a file to an FTP server. I only have the FTP server name (and not its IP address).

I tried using the **dnsclient** library however when compiling, I am getting the following errors:

```
lib/dnsclient/dnsclient.cpp:206:86: 'htons' was not declared in this scope
lib/dnsclient/dnsclient.cpp:299:59: 'htons' was not declared in this scope
lib/dnsclient/dnsclient.cpp:419:32: 'class IPAddress' has no member named 'raw_address'

```

I would appreciate any help in getting this resolved.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [May 20, 2018, 3:24am UTC](https://community.particle.io/t/dnsclient-library/41921/2 "2018-05-20T03:24:57Z")

</div>

You could try the stock function [`WiFi.resolve()`](https://docs.particle.io/reference/firmware/photon/#resolve-)

---

<div class="post-metadata">

**Author:** ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)\
**Post date:** [May 20, 2018, 3:47am UTC](https://community.particle.io/t/dnsclient-library/41921/3 "2018-05-20T03:47:30Z")

</div>

What FTP library are you using?

I remember one that allowed you to use either the FTP server name or IP address.

---

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [May 20, 2018, 9:51am UTC](https://community.particle.io/t/dnsclient-library/41921/4 "2018-05-20T09:51:12Z")

</div>

Thank you @ScruffR. Will try it.

---

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [May 20, 2018, 9:52am UTC](https://community.particle.io/t/dnsclient-library/41921/5 "2018-05-20T09:52:19Z")

</div>

Thank you @RWB. I am using the ParticleFTPClient library and it looks like it does accept a hostname. I will also try it.

---

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [May 21, 2018, 2:19am UTC](https://community.particle.io/t/dnsclient-library/41921/6 "2018-05-21T02:19:55Z")

</div>

Thank you @ScruffR. I tried WiFi.resolve() and it worked for the Photon.

What is the equivalent function for the Electron (which is my target board)?

How does one find out in code if board is a Photon or an Electron?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [May 21, 2018, 2:59am UTC](https://community.particle.io/t/dnsclient-library/41921/7 "2018-05-21T02:59:37Z")

</div>

Thanks, I got it.

1. Celluar.resolve()

2. Using compiler directives (Electron PlatformID = 10)
