nameserver issue

I had a working network on my laptop. my wifi adress is 10.39.220.95. Thing were fine for awhile. Then, out of the blue when i rebooted my phone, which was also my wifi hotspot, i was not able to connect to the net.
I am able to ping 1.1.1.1, but connection to the net was not possible. when i checked /etc/resolv.conf, I found the address is not the same group as my wifi address.
cat /etc/resolv.conf
nameserver 10.164.166.213

ifconfig wlan0 10.39.220.95

How do i solve this issue?
I do not want to use 1.1.1.1 as my nameserver

I have had this issue before n it was resolved itself.
 
Doesn't need to be. As long as there's a route to those addresses the actual DNS server IP addresses can be anywhere on the network.
Tq. Still, I am unable to connect to the net. I had to reboot my wifi hotspot several times. Do doas service netif restart && doas service routing restart several times too, to get to the same network group.
Only then am I able to connect to the net.
 
Wrong conclusion, you ARE connected to the net, or else the ping to 1.1.1.1 would have failed too. You have (or had) a problem resolving.

oops!!! I should have clarified that i could only ping 1.1.1.1 only. I was unable to browse or do any pkg update or git pull.
May I know why was I not able to browse whence i could ping successfully!
 
You fail to grasp some basics, DNS is like a phone book, you use it to lookup a name to find their phone number, you then pick up the phone and dial the number. Not having access to a phone book doesn't mean the telephony system isn't working.
 
You fail to grasp some basics, DNS is like a phone book, you use it to lookup a name to find their phone number, you then pick up the phone and dial the number. Not having access to a phone book doesn't mean the telephony system isn't working.

I do not know much about networking, but i do understand that. But u still failed to answer my question why i could not browse the net!
 
i could not browse the net!
Because the phonebook (DNS) failed. So you cannot resolve hostnames to IP addresses. But this doesn't mean you're not connected to the internet. If you can ping an IP address on the internet then you are connected. Now you have to figure out why you apparently keep getting bad or incorrect DNS.

You are using your phone as a wifi hotspot to connect to the internet, right? How does your laptop connect to that?
 
Because the phonebook (DNS) failed. So you cannot resolve hostnames to IP addresses. But this doesn't mean you're not connected to the internet. If you can ping an IP address on the internet then you are connected. Now you have to figure out why you apparently keep getting bad or incorrect DNS.

You are using your phone as a wifi hotspot to connect to the internet, right? How does your laptop connect to that?
I connect automatically. below is part of my rc.conf

wlans_iwlwifi0="wlan0"
ifconfig_wlan0="WPA DHCP powersave"
ifconfig_wlan0_ipv6="inet6 accept_rtadv"
background_dhclient=yes
defaultroute_delay=0
defaultroute_carrier_delay=0
gateway_enable=yes
 
Why do you have gateway_enable turned on? Unless your laptop is used as a router you don't need it.

But anyway, you are using DHCP, which means you get an IP address, subnet mask, gateway address and usually one or more DNS servers from the DHCP server. The DHCP server runs on your phone, it is the hotspot. Did you enable a firewall on your laptop?
 
Why do you have gateway_enable turned on? Unless your laptop is used as a router you don't need it.

But anyway, you are using DHCP, which means you get an IP address, subnet mask, gateway address and usually one or more DNS servers from the DHCP server. The DHCP server runs on your phone, it is the hotspot. Did you enable a firewall on your laptop?
Why do you have gateway_enable turned on?
As I have stated, I do not know much about networking. I just follow the tips online.
I will disable gateway as you stated.
Yes, I do enable firewall on my laptop.
 
Yes, I do enable firewall on my laptop.
Your firewall rules might be blocking access to some of the DNS IP addresses you're getting from the hotspot. Try with the firewall disabled, that should be fine, the hotspot is doing NAT so you system isn't directly accessible from the internet anyway.
 
Back
Top