However, after reboot, it's still not in /etc/resolv.conf and DNS lookup doesn't work (it does when manually adding the 8.8.8.8 to /etc/resolv.conf, however this is only temporary) . So, what's the correct way to set the DNS server for the OpenWRT system itself?
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
list dns '1.1.1.1'
list dns '1.0.0.1'
option peerdns '0'
config interface 'wan6'
option device 'eth0'
option proto 'dhcpv6'
list dns '2606:4700:4700::1111'
list dns '2606:4700:4700::1001'
option peerdns '0'
This sets up your router to use Cloudflare's DNS. Change as required.
# Configure DNS provider
uci -q delete network.wan.dns
uci add_list network.wan.dns="1.1.1.1"
uci add_list network.wan.dns="1.0.0.1"
# Configure IPv6 DNS provider
uci -q delete network.wan6.dns
uci add_list network.wan6.dns="2606:4700:4700::1111"
uci add_list network.wan6.dns="2606:4700:4700::1001"
# Disable peer ISP DNS
uci set network.wan.peerdns="0"
uci set network.wan6.peerdns="0"
# Save changes
uci commit network
# Restart network service to reflect changes
/etc/init.d/network restart