Multicast DNS problems - dns

Feeling a bit lost after many days of relentless digging and looking for inspiration...
The story so far:-
I have a Microchip PIC32-based wifi-dev board running TCP/IP stack v5.36.
After boot-up, the app works fine when requesting the default 'mchp.local' domain name in the browser. The web browser receives updates correctly every second from the embedded web server on the PIC.
After an indeterminate time however (usually about 1 hour or so), the 'mchp.local' page times out and the browser reports
'ERR_NAME_NOT_RESOLVED: The server at mchp.local cannot be found. because the DNS lookup failed.'
And yet, I can access the app on its corresponding IP address (in this case 172.16.15.103) and I see the app is running fine.
I also see infinite loop in the the main() routine is running as expected and the web server is responding to changes when I request pages using just the IP address.
I have tested using Chrome on Windows and Mac machines - same issue.
I have tried using Packet Peeper (a free network packet analyser for Mac OS X) to filter out all messages NOT on UDP port 5353 (as per RFC 6762) and I see nothing useful.
I have trace-debugged the code and found that the mDNS state machine is in DEFEND mode, both before and after the moment when the app stops responding with DNS "ERR_NAME_NOT_RESOLVED".
I suspect the problem lies in the multicast DNS module but my findings so far do not help me to piin point the root cause.
Any clues? Where should I look next?
My environment:
Mac OS X 10.9.5 (Mavericks)
Browser: Chrome v.44
Embedded Kit uC: Microchip PIC32MX695F512H
Embedded Kit WiFi interface: Microchip MRF24WB0MA
Dev Tools: PICKit3, MPLAB X IDE v2.25, Packet Peeper 2014-06-15

Related

getting issues while trying to call api (local host) from real ios device(Mac OS)

first, I run the nodeJs server on localhost
then I tried to call API's from my real ios device, but I’m getting issues while connecting with local host
everything in working fine in case of android device and emulator
Try binding the backend on 0.0.0.0 if you want to test from a different device, but in the same network. The 0.0.0.0 will listen on all network interfaces where localhost might only listen to your local loopback net device.
You should also point to your network address where the backend is running from your iOS device.
You may find this other stack overflow question helpful.
That localhost URL would make the iPhone try to reach out to itself, you need to set that variable to an IP or URL that the iPhone can actually reach out to. You may find it helpful to use a tunnelling service like ngrok which will make an external URL that your server's localhost can be reached at.

Linux Xdebug (again)

Environment:
Windows 10 > Linux (Ubuntu Server) via LAN
PhpStorm
Followed https://xdebug.org/wizard.php
and https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html
php.ini (/etc/php/7.2/fpm/php.ini as using Nginx) has:
zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_enable = On
xdebug.remote.connect_back = 1
;xdebug.remote_host=192.168.56.1;commented out as copied from another PC with VBox (x-debug working here) but left for reference
xdebug.remote_port=24680;port 9000 is usually occupied by FPM, so port change recommended
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
xdebug.remote_log="/tmp/xdebug.log"
* EDIT- using xdebug.remote_host=192.168.0.201 works but I want to use multiple network locations to debug from preferablly also WAN *
I have setup bookmarklets as per PhpStorm link and clicked the bookmarklet:
javascript:(/** #version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()
In the actual IDE the View>debug window is greyed out but allow incoming connections all green. The Language>PHP>Debug is set to stop at first line and has same port number 24680.
In setups on other systems I have at least had flagged up that mappings need attention but I simply cannot get to any debug view here.
tail -f /tmp/xdebug.log
gives:
Log opened at 2018-08-24 21:52:05
I: Connecting to configured address/port: localhost:24680.
W: Creating socket for 'localhost:24680', poll success, but error: Operation now in progress (29).
W: Creating socket for 'localhost:24680', poll success, but error: Operation now in progress (29).
E: Could not connect to client. :-(
Log closed at 2018-08-24 21:52:05
Showing response.
Obviously something missed with connecting back to Windows client PhpStorm.
Tested with Windows firewall off
I will also need to connect remotely via port forwarding to this server at some point, however all this initial setup is on LAN.
When I mention setups regarding other systems they are physically seperate (IE Macbook talking to its own VBox). This setup is a windows machine talking to a real Linux server on the same LAN. SSH is not used here.
php.ini is (/etc/php/7.2/fpm/php.ini as using Nginx)
Anyone got any idea ?

Unable to open apache website from internet of my Raspberry Pi B+ V2

I setup Apache server on my Raspberry Pi.
In LAN it is working fine.
But when I tried to open it with my public IP it simply gets Timed Out.
I opened a Port : 2323
Checked on canyouseeme.org
Means I have configured port forwarding correctly...?
Now I am trying to open this page with url: 122.175.144.237:2323 it shows Time Out Error.
I have 2 devices
Binatone ADSL2/2+ Modem+router
Tenda N3 Wirless N150 WiFi Router
and my Raspberry Pi is connect with WIFI with static IP 192.168.192.99
I searched for this problem but till now not found any appropriate solution.
Is there any problem in configuration of Apache? or I missed some configuration. or it is because of apache restricting to open page with public IP or not allowing to open over internet.
Is there any way..?
Even if the port is open on the external interface of your router, that doesn't necessarily imply that port forwarding is setup correctly, just that the router isn't flat-out rejecting that traffic. Also, as you have a second wireless router in your network (that is probably itself running NAT), you must also have port forwarding setup on that as well.
Apache must also be configured to answer for the virtual host it is being addressed as. It should answer on it's IP with a default page, but without knowing specifics I couldn't rule it out.
That should get you started, but at this point you still need to narrow the problem down quite a bit before proceeding.

This webpage is not available, The connection to xxx.domain.pl was interrupted, only first pageload

I'm experiencing odd error while trying to load my web page in browser. When I haven't opened it for some period of time and then try to open it just by typing address in browser and clicking enter:
1) The page doesn't load - browser message that it is not available, connection to .... was interrupted
(in Opera there is also info about proxy, network... i can paste it later when error repeat again)
2) after refreshing, loading page again it works ok (without any problem)
My web page address is crib.pl and subdomains niemiecki.crib.pl, hiszpanski.crib.pl
it is important to note that when i try first time load for example niemiecki.crib.pl then it doesn't open but next opening hiszpanski.crib.pl will open normaly also.
Some additional info:
- hosting is in bluehost (Utha, USA)
- I'm trying to access this from (Poland, Europe)
- website is on drupal
- it works for more than 4 years without problem on this server
- it works even week ago without a problem and it doesn't work since 31 december 2014
- bluehost support doesn't have any idea, they say it works perfectly 1-to-1 cases (no problem)
(If you can check it and type your country and whether yes/no you are expiriencing similar problem)
- I haven't modified anything on the web page (problem just happens without my interaction)
- Google crawlers seems to have some problems with accessing robots.txt (sth like that) file
- domain is hosted by company in Poland (crib.pl) and this domain is set using external DNS to bluehost.com servers
Any help save my life, I'm experiencing about 50% drop in earnings since this problem!
Opera message:
"
This webpage is not available
The connection to crib.pl was interrupted.
Check your internet connection.
Check any cables and reboot any routers, modems, or other network devices you may be using.
Allow Opera to access the network in your firewall or antivirus settings.
If it is already listed as a program allowed to access the network, try removing it from the list and adding it again.
If you use a proxy server...
Check your proxy settings or contact your network administrator to make sure the proxy server is working. If you don't believe you should be using a proxy server: Go to Applications > System Preferences > Network > Advanced > Proxies and deselect any proxies that have been selected.
"
There is definitely something wrong with the Bluehost box (i.e. the server behind the IP address 66.147.244.170). From Australia at 2015-Jan-05 12:19:36 UTC, I was able to reproduce a "Connection reset by peer" error just using curl, which corresponds to the browser message "connection to .. was interrupted".
Other times, it just hangs while trying to establish a connection.
In addition, other servers on the same subnet also owned by Bluehost appear to be working fine.
For example:
$ telnet 66.147.244.22 80
Trying 66.147.244.22...
Connected to 66-147-244-22.unifiedlayer.com.
Escape character is '^]'.
^]
telnet> q
Connection closed.
This tells me that it is not a routing problem on the public Internet either.
Also, after a while I tried again it succeeded in opening a connection. So, you're right that the problem is intermittent.
In other words, I think the issue lies with this particular Bluehost box. It could be one of the following causes:
OS is out of file descriptors
Apache or whatever mail server is too slow to service requests and therefore has maxed out its listen backlog
other server resource limits (perhaps memory) or network equipment issue localized to the hosting environment
Best to check with Bluehost again. My guess is that one of the other tenants sharing that server is getting heavily loaded periodically.
Yes, as I thought before the problem was with bluehost box.
Now seems that the problem has been fixed. Here's what I have done:
1) I upgraded bluehost account (standard shared to pro shared)
I do this because want to change IP address and bluehost box without changing crib.pl
domain external DNS servers configurations (it is set to bluehost)
I also would like to have automatic migration, because haven't too much time now.
2) After upgrade I get new IP address and new bluehost box but it also didn't work correctly
3) So I switch on dedicated IP option and after that about 6 hours later when dedicated IP was propageted properly website seems to work again correctly (one problem it cost me about 120$ for next year and shortening my plan for 1 year then previously)
4) the most frustrating issue was bluehost technical support approach which wasn't eager to help me in any why even though the problem was in their server configuration not my code !

CentOS server: how to detect network status changes

I have setup a CentOS 6.4 server (minimal install) which is connected to network through an ethernet cable. The problem is that when the network link goes down, the status changes are not automatically detected but if i type "ifconfig" the interface still keeps its IP address (which is assigned by a DHCP server). After some time that the link is down the interface loses the address but when the link comes up again the network connection is not automatically restored like it would happen in a desktop computer. Even the command "dhclient eth0" does not always work to restore things, and I have to restart the whole network service with "/ect/init.d/network restart".
Is there any way to automatically detect network status changes like it happens in desktop installations? I'm thinking about a cron script that every 5 minutes pings a server outside my network and if it doesn't get any response it restarts network service, but this does not sound very efficient... is there another way?
EDIT: I realized I have not explained the situation correctly. My network topology is: server --> switch --> router --> external network (the router is another centos server with DHCPD).
For some reasons (that i'm not getting), when it happens that the router goes down and reboots, the other server becomes unreachable, and I have to manually restart network service on it. So the link does not effectively go down (the switch keeps it up), but the status change is at IP level.
You can check if you have NetworkManager enabled, I usually don't use it in the servers but it can help you in this case because it will monitor automatically the connections (it is quite common in desktop installations).
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-NetworkManager.html
To look for messages indicating an issue with the NIC just check the kernel ring buffer using the dmesg command.
For example when the cable is disconnected from a given interface this is what I get:
igb: eth1 NIC Link is Down
The first word will depend on the name of your network driver.
You could also configure the system to log these messages also to /var/log/messages (by default I am not sure if they appear there). Then it would be just a matter of monitoring the log, look for similar messages and restart the network service.
In any case the NetworkManager, if it is not already enabled, it should be an easier solution.
There is a module called miimon for monitoring the network interface's status. ethtool will give you the link status.
$ethtool eth0
...
Link detected: yes

Resources