Domain name resolution for NodeMCU as an access point - networking

I was reading through the NodeMCU documentation on enduser setup Module, and now I have a little confusion about the following statement:
Connect to that SSID and then navigate to the root of any website (e.g., http://example.com/...
A web page will load, allowing the end user to provide their Wi-Fi information.
With default configuration, the NodeMCU access point has an IP address: 192.168.4.1.
My question is, how is www.example.com resolved so that it points to the module's access point IP address (192.168.4.1)? Is there any default DNS configuration for the module?
Full documentation is available here.

It simply always returns the IP of the ESP for every DNS query.
You can see that in line 1491 of the source code. (enduser_setup.c)
The enduser_setup_dns_recv_callback will always return the IP that is being retrieved by calling wifi_get_ip_info.
Line 1470:
wifi_get_ip_info(if_index , &ip_info)
Line 1491:
c_memcpy(&(dns_reply[insert_byte]), &(ip_info.ip), 4);

Related

AzerothCore - still looping to realm selection even after updating IP address (Docker install)

I have followed the guides at https://www.azerothcore.org/acore-docker/, and everything installs and works fine. Auth, WorldServer, DB, etc all work. However, when trying to play locally (LAN, main computer with client, the server on a different Windows machine on same LAN), it consistently loops back to realm selection.
So, I searched here and found these two questions/answers:
Azerothcore: Looping on Realm Selection List
How to resolve sticking in "Realm Selection"?
I have followed the guide in the bottom one, and have changed the Address field in the database to my external IP address (assigned by ISP). The LocalAddress is 127.0.0.1 The rest of the information appears to be correct.
When trying to connect via the external IP, it won't connect at all. But when I try setting my realmlist to 127.0.0.1 it will connect and log me in, but continually loops back to the realm selection screen.
To make sure it was updating, I changed the name of the realm and it shows up correctly when I try and log in. So the data appears to be saved to the database, but I cannot get it to connect from the LAN.
Followed the official guides, and changed the IP address in the DB to external IP. Same result, except now it takes a few seconds to connect and try to log into the realm. Then fails, back to realm selection.
Help would be appreciated. Thanks.
It's 99.9% related to your networking. That's what it turns out to be for pretty much everyone asking this question.
Most likely either a port isn't forwarded correctly, or your firewall prevents the connection. Try and use an external service to verify if the port is open. (Do a search for "Port open check"). Also, check your firewall to have the worldserver listed as an exception in the right folder.
Another common mistake is to change the "default" values when using HeidiSQL in the realmlist db instead of changing the actual values in the 'data' tab.

strongswan: What is the difference between left and leftid?

This tutorial use left parameter when setup strongswan, while this tutorial also use leftid parameter. What is the difference between left and leftid?
Found answer from here:
One defines the local IP address(es), `left`, which does not have to be specified
unless it should be restricted. The other, `leftid`, the local identity used during
authentication, which will default to the local IP address or the subject DN of the
local certificate, if one is configured.
Note that the convention is to use `left...` options for local settings and `right...` for
those of the remote, but they might get swapped if an IP in `right` is found locally.
Please refer to the man page for ipsec.conf (`man ipsec.conf`) or the [wiki page for
the conn section][1] for details.
----
You can't set `left` to an IP address that's not installed on any local interface. As you
can see in the log, the daemon won't be able to send packets from that address.
Likewise, inbound request are dropped because the destination address doesn't match
the config (the `no IKE config found for ...` message). So either don't configure it (same
as setting it to `%any`) or configure a local address from/on which packets can be
sent/received (e.g. `172.30.13.1` in your case).
[1]: https://wiki.strongswan.org/projects/strongswan/wiki/Connsection

How do we get public IP history

I got my public ip by www.whatismyip.com, but it changed every modem restart. Any hope to get a list of public ip as history.
Kindest Regards,
There are three ways I can think of to achieve this:
Router Logs
External DNS Service
Custom Tool
Router Logs
This is highly dependent on the model of your router and what it stores. Consult your router's documentation for more specific instructions.
External DNS Service
This would be the easiest to do. On your router you would configure a dynamic DNS service such as No-IP, DynDNS, etc.
I am not sure about DynDNS, but for No-IP, they have 90 days of IP address history for their "Plus Managed DNS" paid plan.
Custom Tool
If you are tight on budget, you could write a script that pulls the results of www.whatismyip.com or a similar service every time you turn your PC on or on a regular schedule.
The simplest address to pull would be to download http://checkip.dyndns.org which is a page with "Current IP Address: 155.143.XXX.XXX" as it's content. Download the file, check if the last one is different, if different, save to a CSV file. There are various grievances to this, but it's free and could be done with a simple script.
If http://checkip.dyndns.org is too simple, you can also use https://ifconfig.co

IIS 10 Site Bindings wildcard development machine

I have successfully setup IIS on my local development machine (dev branch - setup as localdev.me) but when I went to setup another branch (hotfix - setup as localhotfix.me) I am running into issues. The issues are due to the way the site is setup. The subdomain of the url is used to determine which Database to connect to. So going to host.localdev.me will connect to the host database. So in IIS I have the following settings for the bindings of the site.
Type Host Name Port IP Address
http localdev.me 80 *
http *.localdev.me 80 *
I can ping localdev.me with any subdomain and I get the loopback address as expected. When I then setup the hotfix branch (exactly the same as the dev but with the following bindings) I get name not resolved errors.
Type Host Name Port IP Address
http localhotfix.me 80 *
http *.localhotfix.me 80 *
Is there a reason the first setup would work and not the second? What is perhaps even stranger if I tell IIS to stop I can still ping subdomains on localdev.me and get the loopback address.
I could always get it working by manually specifying the host name in my windows hosts file but I would rather not do that as I would need to go in and edit the file every time we add a new subdomain.
EDIT: These are the specific errors I am getting.
ping localhotfix.me
Ping request could not find host localhotfix.me. Please check the name and try again.
EDIT2: I have a solution that works fairly well. It requires Acrylic DNS and installation of the Microsoft Loopback Adapter. I set the loopback adapter to a valid IP Address and set the DNS server to 127.0.0.1 then edit the AcrylicHosts file to contain entries for each domain with a wildcard. Once I did all of this I was able to ping localhotfix.me along with *.localhotfix.me. I believe the reason localdev.me worked is because it is a valid domain. The name would resolve at which point I believe IIS was able to take over. But thats really just an educated guess. But kindof makes sense as to why it worked for one and not the other.
The reason *.localdev.me works without a hosts file is because the public DNS for that domain resolves to 127.0.0.1 as long as it is not localdev.me or www.localdev.me. You can check this using nslookup *.localdev.me (replace the asterisk with anything except www) while your hosts file is empty. On the other hand, *.localhotfix.me is not registered in public DNS at all, which is why you'd need a hosts file entry for those.

Project Zomboid Server Google Compute Engine

I've been trying to set up a server using Google Compute Engine but find myself being stuck.
I've installed everything that needs to be installed, I can start the server, no problem. Only thing is, i'm unable to connect to the server.
I've opened the required ports in a firewall rule (udp:16261; tcp:16262-16270) for all source IP as normal, but when I try to connect, i get this message on the server's console :
User jet is trying to connect.
Connected new client jet ID # 0 and assigned DL port 16262
testing TCP download port 16262
And it waits and waits, nothin happens. I'm pretty sure it's because no connection has been requested from the outsite of the network on that specific port (16262) that the outgoing traffic can't be sent, but I was wondering if anyone else has tried to make it work.
Thanks for your help guys !
According to the documentation; in the "Forwarding Required Ports" Section:
Project Zomboid dedicated servers require the following open ports to successfully connect to clients:
8766 UDP
16261 UDP
If the client's public ip address is known, you can perform a basic troubleshooting whitin Google Compute Engine using Cloud Logging. A basic query returning all the logs containing that ip address as source or destination would be:
jsonPayload.connection.src_ip="public-ip-address" OR jsonPayload.connection.dest_ip="public-ip-address"
Firewall Rules Logging has to be "on" for every rule involved in the connection. Follow these steps for Enabling firewall rules logging.
For troubleshooting purposes an "allow all" Firewall rule can be created and logging enabled on it, that would allow you to see exactly what ports are involved.
Note: If the traffic hitting the firewall rule(s) is too much, it can lead to unanticipated storage costs. Please enable the firewall rules logging just for troubleshooting purposes, don't forget to disable it after you're done.

Resources