Question: I'm working with Microchip's TCP/IP stack and the host name of my device is not being broadcasted, although I can access it using its DHCP assigned IP. 

So the question is, what is the protocol that a network device uses to broadcast its host name, so that when I see a list of devices in a network I can identify it by name? 

Is it the NetBIOS name service or something else? Thanks in advance.

Answer: 
The most network-agnostic way to specify a hostname for a host on the network is through **DNS**, which your device itself cannot control, but all is not lost.

In most environments, the DHCP and DNS servers are tied (AD in Windows networks, DNSMasq on linux, etc...) so your best option is to rely on this behaviour. When you request an IP using DHCP, the DHCP protocol allows you to specify the hostname you'd like to use and if the network is set up to allow DNS entries to be created and maintained by the DNS server, the hostname you send during your DHCP request will typically be used.

The DHCP parameter is called '**Hostname**'. The Network protocol documentation for this parameter is located in [RFC 2132](https://www.rfc-editor.org/rfc/rfc2132#section-3.14), and explained [here](http://www.networksorcery.com/enp/protocol/bootp/option012.htm).
I guess you've solved this by now but I modified the dchp.c file in the Microchip stack and added the following to the options part of \_DHCPSend().

```
// host name
i = strlen(AppConfig.NetBIOSName);
UDPPut(12);     //host name code
UDPPut(i);      //length
UDPPutString(AppConfig.NetBIOSName);

```

This worked for me.