# hostname

**URL:** <https://forums.digi.com/t/hostname/9985>\
**Category:** Rabbit\
**Created:** [October 18, 2007, 3:54pm UTC](https://forums.digi.com/t/hostname/9985 "2007-10-18T15:54:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stech](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@stech](https://forums.digi.com/u/stech)\
**Post date:** [October 18, 2007, 3:54pm UTC](https://forums.digi.com/t/hostname/9985/1 "2007-10-18T15:54:56Z")

</div>

I have written a program for Rabbit 2100 in NetBIOS to acquire dynamic IP from DHCP. I have assigned a hostname of my choice to that. When i ping the acquired dynamic ip, i am getting reply. But f I ping with the hostname which i assighed, reply is not getting. Is it like the hostname i have assigned is not registred? If so how can I register it in Rabbit 2100?

---

<div class="post-metadata">

**Author:** ![Johnno](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Johnno](https://forums.digi.com/u/Johnno)\
**Post date:** [November 7, 2007, 5:39pm UTC](https://forums.digi.com/t/hostname/9985/2 "2007-11-07T17:39:54Z")

</div>

Hi,

I’m having the same problem. How did you assign the hostname? I used the function sethostname(); but it doesn’t seem to work. When I use sethostname, then later I recall it with gethostname, I keep having a blank hostname.

If you already found an answer, I would appreciate a pointer to the solution or to the correct documentation.

Thanks, and good luck

John

---

<div class="post-metadata">

**Author:** ![baldy672](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@baldy672](https://forums.digi.com/u/baldy672)\
**Post date:** [March 5, 2009, 7:56pm UTC](https://forums.digi.com/t/hostname/9985/3 "2009-03-05T19:56:31Z")

</div>

Not all DHCP servers recognize host names. I implemented pretty much the same solution and it’s worked fine on many home routers but not all. It also doesn’t work on the DHCP server running on our Windows 2000 server but it does work on a Linux-based DHCP server.

Try your device on some other DHCP servers and see what happens. That solution should work pretty well.

---

<div class="post-metadata">

**Author:** ![jonp](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jonp](https://forums.digi.com/u/jonp)\
**Post date:** [January 24, 2008, 1:23am UTC](https://forums.digi.com/t/hostname/9985/4 "2008-01-24T01:23:34Z")

</div>

it works for me with the following:

#define DHCP\_SEND\_HOSTNAME

sock\_init();  
sethostname(“RCM3720”);

at least my DHCP server gets the host name correctly.  
whether your DNS gets updated, depends on how your DCHP server and your DNS are related.

hope this helps,  
Jon

---

<div class="post-metadata">

**Author:** ![Johnno](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Johnno](https://forums.digi.com/u/Johnno)\
**Post date:** [January 24, 2008, 8:11am UTC](https://forums.digi.com/t/hostname/9985/5 "2008-01-24T08:11:31Z")

</div>

Hi there Jon,

Thanks, I will definately give this a try, then post back here to let you know if it worked…

Regards,

John

---

<div class="post-metadata">

**Author:** ![witstudio](https://avatars.discourse-cdn.com/v4/letter/w/c89c15/32.png) [@witstudio](https://forums.digi.com/u/witstudio)\
**Post date:** [March 4, 2009, 2:10am UTC](https://forums.digi.com/t/hostname/9985/6 "2009-03-04T02:10:33Z")

</div>

It not work! Help me please…
