DNS request problem in 4.2 - General Discussion - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

DNS request problem in 4.2


  • Please log in to reply
4 replies to this topic

#1 OZ8ET

OZ8ET

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts
  • LocationHundested, Denmark

Posted 21 March 2013 - 05:20 PM

Yesterday my internet provider "upgraded the Network" and after this my NetduinoPlus2 NTP client will not Work.

(It has been working for month before - and before on NetduinoPlus 1.gen for years).

I have isolated the problem to the DNS call:

 

IPEndPoint ep = new IPEndPoint(Dns.GetHostEntry(servername).AddressList[0],123)  

After timeout I get an Socket error exception.

Having messed around for 24 hours, I decided to make an experiment. I installed a DNS server on my Synology fileserver and changed the DNS address in the NETMF program to the Synology DNS.  

This works! – as it use to.

It doesn’t solve the problem, but proves that my program is still working. My conclusion is that there must be a problem/weakness in the METMF/Netduino DNS that makes this protocol more sensitive to deviations than most other equipment (all other equipment works). My internet provider claims that they have no other problems reported.

Does anyone have an explanation? – or maybe an advice?

I tried:

Using DHCP – same problem Using the router as DNS (192.168.1.1) – same problem Using the providers DNS-IP – same problem Using an open DNS (8.8.8.8) – same problem  

Why does it work with a local DNS-server?

Does IP4 – IP6 has something to do with it (Synology also uses IP6)

?????????????????????????????????????????

 



#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 21 March 2013 - 08:49 PM

Perhaps the DHCP DNS Servers in your router have not been updated with the new WAN DHCP server addresses.  Sounds like a router issue not a Netduino issue to me.



#3 emg

emg

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 21 March 2013 - 08:57 PM

Unless there is an issue with GetHostEntry, it sounds to me as if a bad DNS entry is cached on your router or is mis-configured. Can you replicate your tests on your PC (do an IPCONFIG /flushdns between tests). Manually enter a single DNS server entry (don't use secondary) and then you can try ping by hostname to test.



#4 OZ8ET

OZ8ET

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts
  • LocationHundested, Denmark

Posted 22 March 2013 - 06:36 AM

Thanks for good answers.. I did check the router DNS and tested as you suggest emg, but everything works from the PC.

I just don’t understand why it works with an in-LAN DNS??.

 

Maybe it is a problem with the internet provider however. This morning things have changed a bit.

Right now I am able to use my old software again – strange! – I am digging into it.



#5 OZ8ET

OZ8ET

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts
  • LocationHundested, Denmark

Posted 25 March 2013 - 07:22 AM

In early 4.2 releases there wherer issues with socket (i found this on other threads back in 2011). Have these been solved??

I stille have big problems with latest release.

(This is on NetduinoPlus 1.gen)

 

This is my code (reduced)

 

namespace NetduinoApplication1{	public class Program	{		public static void Main()		{			foreach (string ip in NetworkInterface.GetAllNetworkInterfaces()[0].DnsAddresses)			{ Debug.Print("DNS:" + ip); }			IPEndPoint ep = new IPEndPoint(Dns.GetHostEntry("microsoft.com").AddressList[0], 80);			Debug.Print("Finish");		}	}}

and this is the result I get:

The thread '<No Name>' (0x2) has exited with code 0 (0x0).DNS:8.8.8.8DNS:8.8.4.4A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dllAn unhandled exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll Uncaught exception The thread '<No Name>' (0x1) has exited with code 0 (0x0).Done.The program '[2] Micro Framework application: Managed' has exited with code 0 (0x0).

even when I establish the EPEndPoint with an IP address, I get problems with socket commands.

	new IPEndPoint(IPAddress.Parse(serverip), 123);	using (Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Tcp))	{		s.Connect(ep);		byte[] ntpData = new byte[48]; // RFC 2030		Array.Clear(ntpData, 0, 48);		ntpData[0] = 0x1B;		s.SendTo(ntpData,ep);		if (s.Poll(5000000, SelectMode.SelectRead)) { s.Receive(ntpData); }	}

 

 

all help is highly appreciated.

 

Erik






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.