I navigated to the page with the hostnames and entered both static IPs from my raspi web server and from the router itself. Neither of these have a static DHCP lease (yet) but both are configured to always have the same IP.
I was assuming that if I type something along the lines of
ping -c4 raspi-server-web
on my laptop, where "raspi-server-web" is the given hostname that should work but it doesn't. I also tried raspi-server-web.lan and it doesn't work either. I have also already restarted the device to no avail.
I had this working before but with a local conf in /etc/hosts on my laptop (before I had my router with OpenWrt), so there shouldn't be any obstacles that I am not aware of.
Mhm, I think this could be a local config issue on my laptop. If I ssh into the router and try to ping the raspi server from there via hostname that works. Also if I ssh into the rapsi and try to ping the router with the hostname, that works too.
If your lan devices use the OpenWrt router as NameServer they will be able to resolve internal names into IPs, as you have configured them properly.
To verify that, run the following: nslookup raspi-server-web.lan 192.168.1.1
Only reason for not using static leases so far is that I only run this OpenWrt router since a week and now I basically know how the internet works and have my web server set up and running. I was yet too busy to bother changing a working setup.
When I do the
nslookup raspi-server-web.lan 192.168.1.1
both resolve fine so I think, as eduperez has also pointed out, it has something to do with how my laptop performs DNS resolving. I have upgraded this thing through from 14.04 so god help me please but I'll find it out.
Okay, it seems Ubuntu 18.04 uses 127.0.0.53, an internal DNS for resolving hostnames. Disabled it and manually configured my OpenWrt router as DNS and now it works
Thank you for all your help!
This is most likely assigned by the Network Manager and points to some dnsmasq running on the Ubuntu.
It's possible that NetMan will overwrite the resolv.conf, so it's better if you make the change in NetMan rather than edit the resolv file.