h7h2w
March 5, 2019, 6:05pm
1
Hello, everyone,
Could you please explain, how can i use DNS, provided by my ISP via WAN DHCP (192.168.64.12 and 192.168.64.8)? There is several local resources, which don't work without it.Thank you.
Here are configs:
/tmp/resolv.conf:
search lan
nameserver 127.0.0.1
/tmp/resolv.conf.auto:
Interface lan
nameserver 192.168.64.12
Interface wan
nameserver 192.168.64.12
nameserver 192.168.64.12
nameserver 192.168.64.8
and nslookup result :
root@OpenWrt:~# nslookup cinerama.uz
Server: 127.0.0.1
Address: 127.0.0.1#53
*** Can't find cinerama.uz: No answer
*** Can't find cinerama.uz: No answer
If you're using WAN DHCP, and don't change other settings, your LAN should be using them already.
Remove these and just use DHCP on WAN.
2 Likes
uci -q delete network.lan.dns
uci -q delete network.wan.peerdns
uci -q delete network.wan.dns
uci -q delete network.wan6.peerdns
uci -q delete network.wan6.dns
uci commit network
service network reload
uci -q delete dhcp.@dnsmasq[0].server
uci -q delete dhcp.@dnsmasq[0].noresolv
uci commit dhcp
service dnsmasq restart
ln -f -s /tmp/resolv.conf.auto /tmp/resolv.conf
ln -f -s /tmp/resolv.conf /etc/resolv.conf
2 Likes
h7h2w
March 6, 2019, 8:26pm
4
Thank you. Unfortunately, didn't work.
h7h2w
March 6, 2019, 9:01pm
5
Tried to strictly edit the /etc/resolv.conf file by executing rm /etc/resolv.conf
and echo "nameserver 192.168.64.12" > /etc/resolv.conf commands, now router resolves website address:
root@OpenWrt:~# nslookup ftp7.tn.uz
Server: 192.168.64.12
Address: 192.168.64.12#53
Name: ftp7.tn.uz
Address 1: 192.168.64.175
Address 2: 192.168.64.173
*** Can't find ftp7.tn.uz: No answer
But on windows PC I get error "no internal type for both ipv4 and ipv6 addresses (a+aaaa) records available"
Why did you edit the /etc/resolv.conf file?
All you did was tell your router not to use its internal DNS resolver. You fixed nothing.
Why don't you fix the internal DNS resolution to your ISP servers, then fix your LAN clients?
This is how to set ISP DNS servers on DHCP via the web GUI:
h7h2w
March 6, 2019, 9:21pm
7
Hmm, my router don't have WebUI (only 4 mb flash), so i have to configure it using ssh. Never messed with linux before, so i trying to make settings based on the information, found on web.
Also, i can't use stock firmware because half of the packets, if i connect more than two devices, are lost.
OK,
In /etc/config/network -
config interface 'wan'
option ifname 'xxxxxxx' #leave ifname as-is in current config
option proto 'dhcp'
save
then run /etc/init.d/network reload
This is the same infomraiton contained in Post No. 3.
h7h2w
March 7, 2019, 6:18pm
10
root@OpenWrt:~# ifstatus wan
{
"up": true,
"pending": false,
"available": true,
"autostart": true,
"dynamic": false,
"uptime": 75970,
"l3_device": "eth1",
"proto": "dhcp",
"device": "eth1",
"updated": [
"addresses",
"routes",
"data"
],
"metric": 0,
"dns_metric": 0,
"delegation": true,
"ipv4-address": [
{
"address": "10.35.177.130",
"mask": 27
}
],
"ipv6-address": [
],
"ipv6-prefix": [
],
"ipv6-prefix-assignment": [
],
"route": [
{
"target": "0.0.0.0",
"mask": 0,
"nexthop": "10.35.177.129",
"source": "10.35.177.130\/32"
}
],
"dns-server": [
"192.168.64.12",
"192.168.64.8"
],
"dns-search": [
],
"inactive": {
"ipv4-address": [
],
"ipv6-address": [
],
"route": [
],
"dns-server": [
],
"dns-search": [
]
},
"data": {
"leasetime": 86400
}
}
h7h2w
March 7, 2019, 6:19pm
11
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
option peerdns '1'
config interface 'wan6'
option ifname 'eth1'
option proto 'dhcpv4'
option peerdns '1'
That's your DNS-servers, use them:
ln -f -s /tmp/resolv.conf.auto /tmp/resolv.conf
ln -f -s /tmp/resolv.conf /etc/resolv.conf
h7h2w:
option proto 'dhcpv4'
Fix it:
uci set network.wan6.proto="dhcpv6"
uci commit network
service network reload
2 Likes