Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Static IP configuration not resolving names
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Hammett
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 167
Location: Barcelona, Catalonia

PostPosted: Sun Sep 27, 2020 4:30 pm    Post subject: [SOLVED] Static IP configuration not resolving names Reply with quote

Hi all,

I have set up a Pihole in a raspberry pi3 and set up my gentoo box with static IP to point the DNS server towards the pihole. The pihole is sitting in my network on 192.168.1.11.

The setup is working OK, as long as the pihole is up and running. If for whatever reason the pihole is down, the gentoo box is not resolving names.

This is the working configuration:

/etc/conf.d/net
Code:
config_eno1="192.168.1.9/24"
routes_eno1="default via 192.168.1.1"
dns_servers_eno1="192.168.1.11 1.1.1.1"


cat /etc/resolv.conf
Code:
# Generated by netifrc for interface eno1
nameserver 192.168.1.11
nameserver 1.1.1.1


Now I make the following changes (change the dns servers):
/etc/conf.d/net
Code:
config_eno1="192.168.1.9/24"
routes_eno1="default via 192.168.1.1"
dns_servers_eno1="8.8.8.8 1.1.1.1"


I look at the /etc/resolv.conf after restarting the net service:
Code:
# Generated by netifrc for interface eno1
nameserver 8.8.8.8
nameserver 1.1.1.1


but the box will NOT resolve any names despite DNS servers being correct in resolv.conf

This is the error message I get:
Code:
[hammett][/home/hammett]$ ping www.google.com
ping: www.google.com: Temporary failure in name resolution


I can ping to 8.8.8.8 and 1.1.1.1 and get a response, but for whatever reason names are not resolved.

Any ideas??
_________________
I don't fear the people. I fear the demon inside them.


Last edited by Hammett on Mon Sep 28, 2020 6:23 am; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Guru
Guru


Joined: 23 Mar 2019
Posts: 557

PostPosted: Sun Sep 27, 2020 6:22 pm    Post subject: Reply with quote

Hi please try this:
Code:

dig @1.1.1.1 google.com
dig @8.8.8.8 google.com

And check if you get a record.
If yes it means for some reason netifrc is disregarding the nameserver entries both in conf.d/net and resolv.conf.
Which is unlikely.
Maybe try rebooting and see if it works with the updated config?
Maybe also disable any dnsmasq or dhcpcd daemon running and check what happens.
Back to top
View user's profile Send private message
Hammett
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 167
Location: Barcelona, Catalonia

PostPosted: Sun Sep 27, 2020 6:58 pm    Post subject: Reply with quote

Hi,

I do not have dnsmasq nor dhcpcd installed on my system. I also tried a reboot, but did not help either.

I did check both commands, but I do not get records:
Code:
dig @8.8.8.8 google.com
; <<>> DiG 9.16.6 <<>> @8.8.8.8 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Code:
dig @1.1.1.1 google.com
; <<>> DiG 9.16.6 <<>> @1.1.1.1 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

_________________
I don't fear the people. I fear the demon inside them.
Back to top
View user's profile Send private message
alamahant
Guru
Guru


Joined: 23 Mar 2019
Posts: 557

PostPosted: Sun Sep 27, 2020 9:50 pm    Post subject: Reply with quote

Then it is a firewall issue.

Please check if you have a firewall enabled in your lan.
Do you?
Which forwarder does your pi dns server use?
Is it some external dns like 8.8.8.8 etc or the router address?
Maybe your isp is somehow blocking queries to dns servers other than the router.
Maybe he is blocking incoming/outgoing UDP packets from/to 53 port.
Why would they do that?
Also please log into your router and check if a rule like above exists and delete or deactivate it.
Back to top
View user's profile Send private message
Hammett
Apprentice
Apprentice


Joined: 26 Jan 2005
Posts: 167
Location: Barcelona, Catalonia

PostPosted: Mon Sep 28, 2020 6:21 am    Post subject: Reply with quote

Hi,

I double checked the firewall in my computer, as the pi returns a response when I issue a "dig @8.8.8.8 google.com". I did not thought of it as the pi is around 1 year old and before I used those DNS addresses and everything was fine.

Upon inspection of my rules, I have discovered the port 53 line was commented out (my default policy is DROP). Once I enabled this port, no issues anymore.

I feel a bit embarassed! :oops:

Thanks for the help
_________________
I don't fear the people. I fear the demon inside them.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum