LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2023, 08:58 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Rep: Reputation: 177Reputation: 177
router not resolving domain name


I have a Slackware 15.0 computer that was previously connected to an ASUS RT-AC66U B1 router with LAN IP 192.168.0.1. The Linux computer was able to connect to the Internet using 192.168.0.1 as the nameserver. The Linux IP was 192.168.0.2.

I moved that computer to a Netgear Nighthawk X4S R7800 with LAN IP 192.168.1.1. The linux computer now has IP 192.168.1.60. Now, I cannot resolve domain names using 192.168.1.1 as the nameserver, but I can do so using 8.8.8.8 or the ISP's nameserver:
Code:
# dig yahoo.com @192.168.1.1

; <<>> DiG 9.16.44 <<>> yahoo.com @192.168.1.1
;; global options: +cmd
;; connection timed out; no servers could be reached

# dig yahoo.com @8.8.8.8

; <<>> DiG 9.16.44 <<>> yahoo.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21058
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;yahoo.com.                     IN      A

# dig yahoo.com @209.18.47.61

; <<>> DiG 9.16.44 <<>> yahoo.com @209.18.47.61
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27114
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;yahoo.com.                     IN      A
The nameserver addresses 209.18.47.61 and 209.18.47.61 are configured in the Netgear as nameservers.

Why can I not resolve using the Netgear 192.168.1.1 address as the Linux host's nameserver, but I could do so with the ASUS? I think this is causing me other problems.
 
Old 12-18-2023, 10:07 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Quote:
with LAN IP 192.168.1.1. The linux computer now has IP 192.168.1.60. Now, I cannot resolve domain names using 192.168.1.1
shouldn't the nameserver be a different number, 192.168.1.0
 
Old 12-18-2023, 10:27 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,717

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Typically a 192.168.1.0/24 network has a valid IP range of 192.168.1.1 - 192.168.1.254. It's common for the router address to be either at one end or the other i.e. x.x.x.1 or x.x.x.254. If the PC is configured for dhcp then it is also typical for nameserver default to the router's IP address. With systemd-resolved its common for the nameserver to be the pc itself since it acts like a dns stub listener.

Are you using dhcp or static ip address and is /etc/resolv.conf as 192.168.1.1? Is there any other settings in the router's dns configuration other then address? Does the pc's route show the router as the gateway.

Last edited by michaelk; 12-18-2023 at 10:39 PM.
 
Old 12-19-2023, 12:42 AM   #4
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
Thanks for your responses. Network configuration continues the befuddle me even after years of doing lots of configs on lots of systems!

To (hopefully) reduce variables, both of the hosts involved have static IPs, netmask 255.255.255.0, gateway 192.168.1.1 (the router). No DHCP. Phones and laptops connecting to the router via wireless and DHCP have no problems resolving domain names.

Both host's Ethernet ports are connected together via a switch. They can each ssh to each other.

Here's my setup:
Code:
                       [Internet]
                            |
              +-------------------------------+
              | Netgear router                |
              | LAN IP 192.168.1.1            |
              | DNS 209.18.47.61; 209.18.47.62|
              +-------------------------------+
 
                     [ETH switch]
                         |
            +---------------------+
            |                     |
+----------------------+   +--------------+  +----------------------+
|       HOST A         |        HOST B    |  | Windows VM on HOST B |
| 192.168.1.60 eth0    |   | 192.168.1.58 |--| 192.168.1.180        |
| 192.168.1.12 wireless|   |              |  |                      |
+----------------------+   +--------------+  +----------------------+
Even though the router has the ISP's DNSes configured, HOST A cannot resolve domain names if 192.168.1.1 is configured in /etc/resolv.conf. If I put one of the ISP's nameservers in /etc/resolv.conf HOST A can resolve. HOST B cannot resolve even if the ISP's nameserver is in /etc/resolv.conf.

The switch does not have an Ethernet connection to the router (and cannot). Perhaps this is the problem with HOST B. Maybe it needs something using HOST A to route, perhaps an iptables setting for forwarding? I've tried using HOST A's 1.30 IP in HOST B's resolv.conf, but no luck there.

The Windows VM also does not resolve domain names no matter what I use as the nameserver, but first things first! How do I get HOST B to resolve?

Later:

I ran the following on HOST A:
Code:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface wlan0 -j ACCEPT
And I put HOST A's IP (192.68.1.60) in HOST B's /etc/resolv.conf. That helped a bit as I can now resolve on HOST B
Code:
# host yahoo.com
yahoo.com has address 74.6.143.26
yahoo.com has address 74.6.143.25
:
but still can't ping from HOST B:
Code:
$ ping yahoo.com
PING yahoo.com (98.137.11.163) 56(84) bytes of data.
From 192.168.1.58 icmp_seq=1 Destination Host Unreachable
I'm still missing something.

Last edited by mfoley; 12-19-2023 at 01:12 AM.
 
Old 12-19-2023, 03:14 AM   #5
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,454
Blog Entries: 7

Rep: Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559
Apparently, there are many users who report DNS problems with Netgear routers:

https://www.reddit.com/r/HomeNetwork..._be_dns_issue/
https://community.netgear.com/t5/Nig...s/td-p/2300407
https://community.netgear.com/t5/Nig...s/td-p/2189485

From what I'm seeing there, a firmware downgrade seems the way to fix it.
 
Old 12-19-2023, 08:50 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,717

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Quote:
Phones and laptops connecting to the router via wireless and DHCP have no problems resolving domain names.
If it was a DNS problem with the router wouldn't phones and laptops have the same problem. The problem I believe is the OP has not configured host A for "internet connection sharing" correctly. How was it initially configured? Have you checked the routes and gateways so they "point" to the new router?

You can use NAT but host A eth0, host B and Windows needs to be on another subnet.

https://docs.slackware.com/howtos:ne...bridge_routing

Last edited by michaelk; 12-19-2023 at 09:04 AM.
 
Old 12-19-2023, 02:51 PM   #7
arespi
LQ Newbie
 
Registered: Apr 2016
Posts: 13

Rep: Reputation: Disabled
Of course this is not the case but similar. My ISP would block access to their internal DNS servers when I was late in payments. All I had to do was to set Google DNS (Or any other public DNS) and voila!, I could navigate again... So in my local network devices always had a public DNS, just in case.
 
Old 12-19-2023, 03:03 PM   #8
yvesjv
Member
 
Registered: Sep 2015
Location: Australia
Distribution: Slackware, Devuan, Freebsd
Posts: 566

Rep: Reputation: Disabled
209.18.47.61 is an IP address that belongs to 'Charter Communications Inc'
Why is this IP address set to use this IP as your DNS resolver? Probably mining dns requests for a multitude of business, marketing, analysis, etc reasons.

The Netgear can be wiped clean and have openwrt installed.
Recommendation is to do that and you will have a solid router/wireless unit for years.
https://openwrt.org/toh/netgear/r7800
 
1 members found this post helpful.
Old 12-30-2023, 01:14 PM   #9
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by michaelk View Post
If it was a DNS problem with the router wouldn't phones and laptops have the same problem. The problem I believe is the OP has not configured host A for "internet connection sharing" correctly. How was it initially configured? Have you checked the routes and gateways so they "point" to the new router?

You can use NAT but host A eth0, host B and Windows needs to be on another subnet.

https://docs.slackware.com/howtos:ne...bridge_routing
I suppose I could continue to play with iptables routing and get this working, but I decided to take the easy way out and modified my setup as follows:
Code:
                       [Internet]
                            |
              +-------------------------------+
              | Netgear router                |
              | LAN IP 192.168.1.1            |
              | DNS 209.18.47.61; 209.18.47.62|
              +----------+--------------------+
                         |
                      [switch]
                         |
            +------------+--------+
            |                     |
+----------------------+   +--------------+  +----------------------+
|       HOST A         |        HOST B    |  | Windows VM on HOST B |
| 192.168.1.60 eth0    |   | 192.168.1.58 |--| 192.168.1.180        |
+----------------------+   +--------------+  +----------------------+
I connect the Linux host's Ethernet ports to the router via a switch (the Windows VM uses HOST B's interface) and discontinued using the wireless mode on HOST A. That was easy enough and saved much experimentation time.

Last edited by mfoley; 12-30-2023 at 01:15 PM.
 
  


Reply

Tags
domain, nameserver, resolution, router



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS resolving IP but not resolving hostnames; ping unknown host google.com mattlyons Linux - Networking 15 02-26-2017 04:01 AM
Domain name is not resolving Rafael25 Linux - Networking 5 03-23-2013 09:05 AM
Set up .name.domain, but how do I set .domain/name Karas Linux - Newbie 1 12-03-2009 09:31 AM
what would make ever virtual domain name resolve to one domain name on my system kuplo Linux - Newbie 1 11-14-2005 06:57 PM
Domain name not resolving proerly Homer Glemkin Linux - Networking 1 01-26-2005 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration