Main Site Documentation

DNS device name


#1

Is it possible to set a dns device name to the mountaineer ethernet board?


#2

I mean the NetBIOS name.


#3

@ miugemelo - Check this codeshare:

http://www.tinyclr.com/codeshare/entry/245


#4

Thank you, I will try it out.


#5

This doesn’t seem to work with the mountaineer mainboard. Is there another way to set the name?


#6

This was your reference. You can’t use it as is. You have to change it for you board.


#7

I’m using the following to initiate my ethernet:



NetBios MyNetBios = new NetBios("Mountaineer");
while (ethernetForMountaineerEth.NetworkSettings.IPAddress == "0.0.0.0")
{
   WriteLogAndDisplay("Awaiting IP Address", true);
   Thread.Sleep(3000);
 }


In the NetBios class I’ve changed the line


Array.Copy(NetworkInterface.IPAddress, 0, outBuf, 58, 4);

to


NetworkInterface netIf = NetworkInterface.GetAllNetworkInterfaces()[0];
 Array.Copy(netIf.IPAddress.Split('.'), 0, outBuf, 58, 4);

but i never get to that line, because


NameQuery == MyNetBiosName.ToUpper()

is never true.

What could be the problem?


#8

Ok yor’re right

i think it must be like this:


...
NetworkInterface netIf = NetworkInterface.GetAllNetworkInterfaces()[0];
byte[] bytes = ConvertToByteArray(netIf.IPAddress.Split('.'));
Array.Copy(bytes, 0, outBuf, 58, 4);
...

private byte[] ConvertToByteArray(string[] stringArray)
        {
            byte[] byteArray = new byte[stringArray.Length];
            for (int i = 0; i < stringArray.Length; i++)
            {
                byteArray[i] = Convert.ToByte(stringArray[i]);
            }
            return byteArray;
        }

Or do i need to convert the string numbers to int first and then to byte?


#9

Sorry, my english isn’t that good.

What do you exactly mean by “you ping your device from the same network segment with no router between?”?


#10

We have a windows server 2012 acting as dhcp server.

I would like to see the netbios name in the leases list of the dhcp server.

My Mountaineer board is using dhcp to get the ip address.


#11

I’ve tried the code from the following thread:

http://www.tinyclr.com/forum/topic?id=2472&page=1

I can ping my mountaineer with the setted name now, but the name isn’t updated in the dns and dhcp.


#12

Thank you Andre for clarifying this.

So i need to wait for netmf to be updated with this :frowning:


#13

Yes, there are probably not that many other people worrying about this. MAC addresses are perfectly acceptable device identifiers in most cases.


#14

Yes, the mac address would be enough to identify the device, but it’s difficult to remember. We will have 25 Mountaineers connected to one network and it would be nice, if we can identify them by name in the dhcp server.