knute
Posts: 697
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 1:50 pm

What happens if you put in a static IP and specify the DNS server you want?

fishani
Posts: 21
Joined: Mon Jun 14, 2021 10:21 am

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 2:09 pm

Hello!


In my attempts to edit the part of the configuration highlighted in red text after putting command sudo nano /etc/dhcpcd.conf i then fail to save the changes made i attempt ctrl O but it doesnt seem to save could you please tell how one can save a file after editing it ?


# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24

#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1


# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

bls
Posts: 1569
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 2:16 pm

A DHCP server typically provides the DNS server addresses for the clients. A vanilla RasPiOS correctly gets these addresses from a properly configured DHCP server. So, here are some things to review
  • Where is your DHCP server? Is it your router? What DNS Servers does the DHCP server think it's handing out? Please check the settings on your router (or wherever your DHCP server is).
  • What DNS servers are your Windows and Chromebooks using? If they are not the addresses you are expecting, what are they? On Windows, you can find the DNS Servers from the command line: ipconfig /all. No clue about Chrome, so let's just look at Windows.
  • Please show the contents of the RasPiOS file /etc/resolvconf.conf
My $.02: Rather than trying different potential solutions, it's always best to sort out the root problem so you don't create an incorrect band-aid that comes back to haunt you in the future.
Pi tools:
Quickly and easily build customized-just-for-you SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

fishani
Posts: 21
Joined: Mon Jun 14, 2021 10:21 am

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 2:58 pm

bls wrote:
Wed Jun 16, 2021 2:16 pm
A DHCP server typically provides the DNS server addresses for the clients. A vanilla RasPiOS correctly gets these addresses from a properly configured DHCP server. So, here are some things to review
  • Where is your DHCP server? Is it your router? What DNS Servers does the DHCP server think it's handing out? Please check the settings on your router (or wherever your DHCP server is).
  • What DNS servers are your Windows and Chromebooks using? If they are not the addresses you are expecting, what are they? On Windows, you can find the DNS Servers from the command line: ipconfig /all. No clue about Chrome, so let's just look at Windows.
  • Please show the contents of the RasPiOS file /etc/resolvconf.conf
My $.02: Rather than trying different potential solutions, it's always best to sort out the root problem so you don't create an incorrect band-aid that comes back to haunt you in the future.
First Question the DHCP server is Windows Server which is also the DC and is also the local DNS server at ip 10.193.220.3 its is not the router its an independent server Handling DNS queries and sending our DHCP leases router is a separate device Ipconfig all cmd
see in blue


Wireless LAN adapter WiFi:

Connection-specific DNS Suffix . : ranelaghcc4.internal
Description . . . . . . . . . . . : Intel(R) Wireless-AC 9560 160MHz
Physical Address. . . . . . . . . : FC-77-74-85-6A-C4
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::b9d2:7b43:1462:e883%10(Preferred)
IPv4 Address. . . . . . . . . . . : 10.193.220.151(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.252.0
Lease Obtained. . . . . . . . . . : 16 June 2021 09:11:07
Lease Expires . . . . . . . . . . : 16 June 2021 20:54:56
Default Gateway . . . . . . . . . : 10.193.220.1
DHCP Server . . . . . . . . . . . : 10.193.220.3
DHCPv6 IAID . . . . . . . . . . . : 184317812
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-26-13-A7-F5-E4-E7-49-4E-EE-4D
DNS Servers . . . . . . . . . . . : 10.193.220.3
NetBIOS over Tcpip. . . . . . . . : Enabled



The router and default getway is on 10.193.220.1 the DNS server is seperate

C:\Users\fndovi>nslookup
Default Server: ran-sr-01.ranelaghcc4.internal
Address: 10.193.220.3

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.193.220.1 10.193.220.151 35
10.193.220.0 255.255.252.0 On-link 10.193.220.151 291
10.193.220.151 255.255.255.255 On-link 10.193.220.151 291
10.193.223.255 255.255.255.255 On-link 10.193.220.151 291
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 10.193.220.151 291
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 10.193.220.151 291
===========================================================================
[color]

Windows devices and chrome books are using the DNS that I mentioned in the nslookup ip 10.193.220.3 they are on the expected DNS addresses the only devices picking out it own external RANDOM DNS well not so random as its cisco openid are the Raspberry pis

# Generated by resolvconf
domain ranelaghcc4.internal
nameserver 208.67.222.123
nameserver 208.67.220.123
pi@raspberrypi:~ $
[color]
then finally the /etc/resolvconf.conf is in yellow



Configuration for resolvconf(8)
# See resolvconf.conf(5) for details

resolv_conf=/etc/resolv.conf
# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
#name_servers=127.0.0.1

# Mirror the Debian package defaults for the below resolvers
# so that resolvconf integrates seemlessly.
dnsmasq_resolv=/var/run/dnsmasq/resolv.conf
pdnsd_conf=/etc/pdnsd.conf
unbound_conf=/var/cache/unbound/resolvconf_resolvers.conf












































^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos M-U Undo M-A Mark Text M-] To Bracket M-Q Previous ^B Back ^◀ Prev Word ^A Home
^X Exit ^R Read File ^\ Replace ^U Uncut Text ^T To Spell ^_ Go To Line M-E Redo M-6 Copy Text ^Q Where Was M-W Next ^F Forward ^▶ Next Word ^E End
[color]

fishani
Posts: 21
Joined: Mon Jun 14, 2021 10:21 am

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 3:03 pm

knute wrote:
Wed Jun 16, 2021 1:50 pm
What happens if you put in a static IP and specify the DNS server you want?
I struggled to save the edited config file no ones helped me out with that

bls
Posts: 1569
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 3:19 pm

So the question is, since Windows is getting the correct DNS server, where is the Pi getting its DNS server information from? There's nothing amiss in /etc/resolvconf.conf (other than yellow being darn near impossible to read :lol: ).

You didn't provide any configuration information from your DHCP server, nor did you address the questions "What DNS Servers does the DHCP server think it's handing out? Please check the settings on your router (or wherever your DHCP server is)."

If your DHCP server is handing out correct DNS Server information, then you have something on your Pi that is deriving the incorrect DNS information. This could be:
  • something in /etc/network/* - Check all the config files there to make sure that they are not doing anything with DNS
  • Another network configuration program that is injecting them - Please provide the output from the command: ps aux | grep -v '\['
  • ??? Until we see the output from the above ps aux command I'm out of ideas :roll:
Don't bother setting static information in /etc/dhcpcd.conf. That will just obscure the issue and set you down a path filled with future hassles.
Pi tools:
Quickly and easily build customized-just-for-you SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

drgeoff
Posts: 12060
Joined: Wed Jan 25, 2012 6:39 pm

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 4:08 pm

Your RPi is on a 10.x.x.x address and you say that is by DHCP.

If the RPI is using DNS servers at 208.67.x.x then either:

1. It is being given that by the DHCP server

or

2. The RPi has been manually configured to do that.

You are the network administrator so you should know which.
Quis custodiet ipsos custodes?

bls
Posts: 1569
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 5:27 pm

drgeoff wrote:
Wed Jun 16, 2021 4:08 pm
Your RPi is on a 10.x.x.x address and you say that is by DHCP.

If the RPI is using DNS servers at 208.67.x.x then either:

1. It is being given that by the DHCP server

or

2. The RPi has been manually configured to do that.

You are the network administrator so you should know which.
Agree, but in order for #1 to be correct, the Windows and Chromebooks would need to have had their DNS server addresses manually configured. There is no way that #1 could be true if this isn't the case.

I was thinking about this while I was out and about, and I think the best thing for OP to do is to blast a fresh SD card, boot it up in the Pi, and report the results, including posting /etc/resolv.conf

If a fresh SD card with NO modifications has only the external DNS servers set, then the DHCP server is not handing out the correct DNS server information AND the Windows and Chromebook systems were manually configured.
Pi tools:
Quickly and easily build customized-just-for-you SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

Ernst
Posts: 1373
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 6:13 pm

IMHO this could be caused by having multiple DHCP servers with mismatched configuration within the same network.
The road to insanity is paved with static ip addresses

hortimech
Posts: 508
Joined: Wed Apr 08, 2015 5:52 pm

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 6:22 pm

Ernst wrote:
Wed Jun 16, 2021 6:13 pm
IMHO this could be caused by having multiple DHCP servers with mismatched configuration within the same network.
I would tend to agree, I think the router is also running a dhcp server, but I think the OP may have a bigger problem. He mentioned an AD DC and it looks like it isn't running on a subdomain of their registered domain, if so, that isn't a good idea.

swampdog
Posts: 719
Joined: Fri Dec 04, 2015 11:22 am

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 6:36 pm

Yeah, the OP needs to start with a fresh rpi image, not fiddle with anything and post contents of /etc/resolv.conf.

I do have a vague recollection windoze DHCP/DNS can be a pig. Maybe something to do with a GPO not thinking the rpi belongs to its domain? Years ago. Can't remember. Could be wireshark time!

epoch1970
Posts: 6686
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 6:47 pm

bls wrote:
Wed Jun 16, 2021 5:27 pm
Agree, but in order for #1 to be correct, the Windows and Chromebooks would need to have had their DNS server addresses manually configured. There is no way that #1 could be true if this isn't the case.
Nope. It is possible:
- if the DHCP server somehow profiles its responses (unlikely but possible)
- if the Pis are indeed in a different network.

If I were a network admin (thank God I am not), I would swiftly configure a MAC-based VLAN for the IP phones on premises. Throughout the premises, they would be in a different network with a special QoS, with me having to configure nothing but a few MAC address patterns in a few network switches.
This strategy is quite common. VOIP phones are everywhere and basically any prosumer switch comes today with a preconfigured "voice VLAN" and can match MACs to VLANs.

Pis can have a few OUIs, this is what Wireshark just told me:

Code: Select all

3A:35:41 Raspberry Pi (Trading) Ltd 
B8:27:EB Raspberry Pi Foundation
DC:A6:32 Raspberry Pi Trading Ltd
E4:5F:01 Raspberry Pi Trading Ltd
There is a distinct possibility for [brand X] chromebook, [brand Y] phones, [brand Z] comps to have internet access on a LAN, and Raspberry Pi products not.
I doubt this explains that in this case, though ^^
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

epoch1970
Posts: 6686
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 7:02 pm

Ernst wrote:
Wed Jun 16, 2021 6:13 pm
IMHO this could be caused by having multiple DHCP servers with mismatched configuration within the same network.
And that would magically affect only Pis?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

bls
Posts: 1569
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 7:20 pm

epoch1970 wrote:
Wed Jun 16, 2021 6:47 pm
bls wrote:
Wed Jun 16, 2021 5:27 pm
Agree, but in order for #1 to be correct, the Windows and Chromebooks would need to have had their DNS server addresses manually configured. There is no way that #1 could be true if this isn't the case.
Nope. It is possible:
- if the DHCP server somehow profiles its responses (unlikely but possible)
- if the Pis are indeed in a different network.
Agree that the first is unlikely. The 2nd is not the case in this instance: Windows IP: 10.193.220.151, Pi IP: 10.193.220.152. Same subnet.

What we don't know is ANYTHING about the DHCP server configuration, whether there are multiple DHCP servers (seems unlikely, since OP would likely be having other issues), or the result of an uncontaminated fresh install.

OP needs to take some of the steps suggested in the past few replies and provide requested information.

And, while OP is at it, please provide output from the Pi (either current one or freshly-installed as suggested) for the command sudo journalctl -b | grep dhcpcd. This will answer the multiple DHCP server possibility.
Pi tools:
Quickly and easily build customized-just-for-you SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

epoch1970
Posts: 6686
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 7:49 pm

bls wrote:
Wed Jun 16, 2021 7:20 pm
Agree that the first is unlikely. The 2nd is not the case in this instance: Windows IP: 10.193.220.151, Pi IP: 10.193.220.152. Same subnet.
VLAN operates at Ethernet level (L2) so what the IP layer (L3) looks like is irrelevant.
It is awkward to use the same IP config in different VLANs because you can’t trunk-and-route properly, but it is possible.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Ernst
Posts: 1373
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: DNS issue on Raspberry pis

Wed Jun 16, 2021 9:29 pm

epoch1970 wrote:
Wed Jun 16, 2021 7:02 pm
Ernst wrote:
Wed Jun 16, 2021 6:13 pm
IMHO this could be caused by having multiple DHCP servers with mismatched configuration within the same network.
And that would magically affect only Pis?
IMHO this could be caused by ...

To be able to analyze this problem a complete configuration (hw/sw) would be required, for this reason I used the word "could" because 40 years looking at problems has taught me that that it is very difficult to understand a problem if you do not have the complete information. A simple deviation, such as the Raspberry Pi connected to different network segment (Wifi or Wired), can be important. Btw. looking at the thread I have the impression that the network configuration may not be a simple as thought.
The road to insanity is paved with static ip addresses

User avatar
B.Goode
Posts: 12255
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: DNS issue on Raspberry pis

Thu Jun 17, 2021 8:02 pm

fishani wrote:
Wed Jun 16, 2021 2:09 pm
Hello!


In my attempts to edit the part of the configuration highlighted in red text after putting command sudo nano /etc/dhcpcd.conf i then fail to save the changes made i attempt ctrl O but it doesnt seem to save could you please tell how one can save a file after editing it ?



A bit Off Topic for alleged DNS issues, but to get it out of the way-


If you don't like or understand the Editor you are using, choose another one. Life is too short to be battling with tools that don't meet your needs.


But in respect of the nano editor:
Ctrl-O brings up a prompt "File Name to Write:" It will probably have the name of the file you are currently editting. Press [Return].
That's all.

knute
Posts: 697
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: DNS issue on Raspberry pis

Sat Jun 19, 2021 1:08 am

fishani wrote:
Wed Jun 16, 2021 2:09 pm
Hello!


In my attempts to edit the part of the configuration highlighted in red text after putting command sudo nano /etc/dhcpcd.conf i then fail to save the changes made i attempt ctrl O but it doesnt seem to save could you please tell how one can save a file after editing it ?
^O and it displays the file name. Press <ENTER> to actually write it. Then ^X to exit program. But since you are editing /etc/dhcpcd.conf which is owned by root and has the permissions 644 rw r r you need to use sudo nano /etc/dhcpcd.conf.

Hope that helps.

fishani
Posts: 21
Joined: Mon Jun 14, 2021 10:21 am

Re: DNS issue on Raspberry pis

Mon Jun 21, 2021 2:34 pm

Hi All

I issue is resolved after reinstalling os Raspbeery pi os the teacher had built that os from home not sure what the configurations were picked "set locale settings "

fishani
Posts: 21
Joined: Mon Jun 14, 2021 10:21 am

Re: DNS issue on Raspberry pis

Mon Jun 21, 2021 2:45 pm

Thank you all for the efforts

Return to “Troubleshooting”