GideonZ / 1541ultimate

Official GIT archive of 1541 ultimate II sources
GNU General Public License v3.0
173 stars 45 forks source link

Please add DNS setting in static ip configuration of U2+ #321

Open Zibri opened 1 year ago

Zibri commented 1 year ago
[Network settings]
Use DHCP=Disabled
Static IP=192.168.2.64
Static Netmask=255.255.255.0
Static Gateway=192.168.2.1
Host Name=Ultimate-II

Please add DNS configuration when IP set to static and no DHCP. (also in the menu) Like:

[Network settings]
Use DHCP=Disabled
Static IP=192.168.2.64
Static Netmask=255.255.255.0
Static Gateway=192.168.2.1
Static DNS1=192.168.1.1
Static DNS2=8.8.8.8
Host Name=Ultimate-II
markusC64 commented 6 months ago

Do I understand right, this missing feature is necessary for usage of the new feature "assembly 64"?

GideonZ commented 6 months ago

No, this is a request from our Egyptian / Italian friend. In 99.9999% of the cases, the DNS is implemented by the gateway, and therefore this is not required to specify the DNS in a network leaf node. Even more so, I wouldn't even know how to implement it, as I haven't seen ways to tell lwIP what the DNS IP should be.

markusC64 commented 6 months ago

Oh well, then I will have to go without dns.

GideonZ commented 6 months ago

I don't understand?

markusC64 commented 6 months ago

Well, internal DNS and Gateway differ in my installation.

I haven't missed DNS for several years on the Ultimate, so I expect that just assembly 64 will cause problems due to missing dns. Not a huge problem, I suppose.

marty41 commented 6 months ago

In 99.9999% of the cases, the DNS is implemented by the gateway, and therefore this is not required to specify the DNS in a network leaf node. Even more so, I wouldn't even know how to implement it, as I haven't seen ways to tell lwIP what the DNS IP should be.

To be a bit more specific, the gateway and the DNS address is supplied via the DHCP protocol, while receiving the devices own IP address. In most cases the DHCP server also is the gateway router at home, that isn't even able to serve a different DHCP address. In some cases (as also in mine. ;) ) there are different solutions used for internal gateway and the DNS server. I think, there must be a possibility to manually configure gateway and DNS in the network settings. For both wired and wireless connection. I do not know any device where it isn't a possibility to set the IP address, network-mask, gateway and DNS server manually.

markusC64 commented 6 months ago

Well, I agree with Marty's statements. Anyway, given that you, Gideon, do not have an idea how to do that, I think I know something more important. Naming that would be completely off topic here.

GideonZ commented 6 months ago

Okay.. I must have misunderstood. Normally, one would configure the DNS just once, if at all, in the router. One would normally not configure a DNS on every leaf node. The DNS addresses then come from the DHCP server in the router indeed. So basically you are saying that you are not using DHCP? Why?

markusC64 commented 6 months ago

If (and probably only if) your DHCP Server is a debian / ubuntu /raspbian installation, using it for fixed addresses (for sure you want to connect to the ultimate from your pc) is hard, you have to add several lines PER DEVICE of configuration in the configuration file. And even worse, you cannot make the file system read only because of that. Conpare: no dhcp means: Just enter IP, Netmask, Gateway and DNS in the client and you're done. No need to rember configuration lines to add to the configutation file.

markusC64 commented 6 months ago

/lwip-1.4.1/src/include/lwip/dns.h:

void dns_setserver(u8_t numdns, ip_addr_t *dnsserver); ip_addr_t dns_getserver(u8_t numdns);

No details, but that seems the function you need to set DNS servers. Cf. https://lists.gnu.org/archive/html/lwip-users/2010-11/msg00141.html

markusC64 commented 6 months ago

4 docs see: https://www.nongnu.org/lwip/2_1_x/group__dns.html

GideonZ commented 6 months ago

Unfortunately these calls are part of the raw API, which are not thread safe. It is illegal to call a mix of raw api calls and netapi calls.