NetBurner 3.5.6
PDF Version
DNS Device Name

DNS Device Name Application

Overview

This NetBurner application demonstrates how to programmatically set a device name that can be used for DNS resolution on a network. The device name is automatically generated using the device's MAC address and stored in the flash configuration.

The device name is stored in the device's Flash System Configuration. There are two ways to give your device a name:

  1. Use the configuration web interface, which is your device's <device ip address>:20034.
  2. You can change the configuration flash setting in your application. You will then need to reboot the device for the name to take effect.

This example demonstrates how to change the device name in an application.

Note
This is not the same as a .local or WINS device name. The network must have a DNS and DHCP server.

Features

  • Automatically generates a unique device name based on MAC address
  • Stores device name in flash configuration for persistence
  • Provides network identification for DHCP and DNS services
  • Simple web interface access for manual configuration

How It Works

The application performs the following operations:

  1. Device Initialization: Sets up the network interface and enables HTTP services
  2. MAC Address Retrieval: Gets the MAC address from the first available network interface (typically Ethernet0)
  3. Name Generation: Creates a device name using the format NetBurner-XXXX where XXXX represents the last two octets of the MAC address in hexadecimal
  4. Configuration Storage: Compares the generated name with the current flash configuration and updates it if different
  5. Persistence: Saves the new configuration to storage and notifies that a reboot is required

Device Naming

Automatic Naming Convention

  • Format: NetBurner-XXXX
  • Example: NetBurner-848F (where 848F are the last two bytes of the MAC address)

Manual Configuration Options

You can also set the device name manually through:

  1. Web Interface: Access <device_ip_address>:20034 in your browser
  2. Application Code: Modify the flash configuration programmatically (as demonstrated in this example)

Network Integration

DHCP Integration

When the device requests an IP address from a DHCP server, it sends:

  • MAC address
  • Device name (optional, but supported)

The DHCP server maintains a table with MAC address, IP address, and device name for each device.

DNS Resolution

For the device name to be resolvable via DNS:

  • Windows Server: Configure DHCP and DNS server integration through dialog settings
  • Linux/Unix: May require additional configuration for DHCP-DNS integration
  • Without DNS Server: Manually add entries to the lmhosts file on each PC

Windows WINS Protocol

Windows machines can use the proprietary WINS protocol for name resolution, where one Windows PC maintains the table of MAC addresses, IP addresses, and names.

Sample Output

Interface 1, Ethernet0, MAC:00:03:f4:0b:84:8f
Current device name from flash configuration: "MODM7AE70SX-848F"
Assigning device name: NetBurner-848F
Reboot device for new device name to take effect
Primary network interface configured for DHCP
MAC Address = 00:03:f4:0b:84:8f
Type "A" to abort boot
Interface 1, Ethernet0, MAC:00:03:f4:0b:84:8f
Current device name from flash configuration: "NetBurner-848F"
New name already matches configuration
DHCP Namespace.
Definition dhcpd.h:39

Key Functions

CreateDnsDeviceName(char *deviceName, uint32_t maxLen)

  • Retrieves the first network interface information
  • Displays current configuration
  • Generates new device name from MAC address
  • Updates flash configuration if name has changed
  • Saves configuration to storage

UserMain(void *pd)

  • Initializes the system and network
  • Enables HTTP services
  • Waits for network connectivity
  • Calls the device naming function
  • Enters main application loop

Important Notes

  • Reboot Required: After changing the device name, a reboot is necessary for the new name to take effect
  • Name Length: Maximum device name length is 32 characters
  • Network Dependencies: Requires active network connection and DHCP configuration
  • Persistence: Device name is stored in flash memory and survives power cycles

Building and Deployment

This application is designed for NetBurner embedded systems and requires:

  • NetBurner development environment
  • Compatible NetBurner hardware module
  • Network connection with DHCP server

Use Cases

  • Network device identification and management
  • Simplified device access by name instead of IP address
  • Integration with existing DNS infrastructure
  • Automated device provisioning in larger networks

Additional Information on DNS Naming

When a network device (such as the NetBurner module) requests an IP address from a DHCP Server, the device sends it MAC address and an optional device name (this is supported by your NetBurner device). The DHCP Server supplies the dynamic IP address and maintains a table containing the MAC address, IP address and device name for each device that has accepted a DHCP lease.

The purpose of a DNS server is to convert a name into an IP address. To do this it must get the information from your DHCP Server. On windows server platforms that run both a DHCP server and DNS server, this can be configured in a dialog box. On Linux it may be more complicated. Basically, every time the DHCP server gives out a new dynamic IP address it updates the DNS server. If you are not using DHCP, and are assigning static IP addresses, then you must update the DNS server with the entries manually (i.e. name and IP address).

If you do not have a DNS server, you can modify the lmhosts file on your PC to add the IP address and name of each network device you want to address by name. You would need to do this on every PC that wants to use the name.

Windows has a proprietary protocol called WINS (only Microsoft products can use it). Windows machines can have a name, and the protocol enables windows machines to talk to one another. This is achieved by having one windows PC maintain the table of MAC address, IP address and names.