Setting Host Name


I was trying to set a host name for my IP address, which mean when i want to access my webrabbit , i also can access it through http://test

i use the sethostname() but it doesnt work is there any setting that i could have miss out? below are part of my code. Thanks

#define TCPCONFIG 1
#define MY_HOST “test”

void main()
tcp_config(“MY_IP_ADDRESS”, “”);
tcp_config(“MY_NETMASK”, “”);
tcp_config(“MY_GATEWAY”, “”);


There are a couple of simple ways that might achieve what you need but both rely primarily on external systems to work.

  1. using the macros DHCP_SEND_HOSTNAME and DHCP_CLASS_ID you can get to register your hostname with the DHCP server (although you seem to be using static IP addressing so it would require a bit of juggling to make this work…). According to the comments in BOOTP.LIB some DHCP servers can use this info to respond to DNS queries and provide name resolution. This is obviously very dependent on your DHCP server

  2. Using the local hosts.txt or equivilant file you could set up a static mapping and then the OS will resolve the names for you.