question about DNS resolve with fix IP and defaultrouter in freebsd14.3 ?

dear all:
i am newguy... now i have made configure with re0 network card in below.
#for Slcom
ifconfig_re0="inet 172.20.1.2 netmask 255.255.255.0"
defaultrouter="172.20.1.254"

the file /etc/resolv.conf configuration as below .
nameserver 1.1.1.1
nameserver 8.8.8.8

i can use my re0 ping gateway ....it's working . but when i ping bing.com it's not work ..
so ii check the dns with command resolvconf -l ,i got nothing...

i think i have fix the IP and gateway. so the dns was not work.

how to fix my issue ? thanks.
 
Chances are you don't have any connectivity beyond your gateway. Google and CloudFlare public DNS 8.8.8.8 and 1.1.1.1 are also pingable, so you should have success if you ping them directly by IP. If that doesn't work, two things could be the matter:

1. Your gateway/firewall blocks those resolvers. Not very likely, but not completely out of the question either.
2. You don't have connectivity beyond your gateway at all.

So.. I looked up Bing for you, and when I did it lived at 150.171.28.10. That IP should also be pingable for you.

If none of the IP's results in a ping, you probably don't have connectivity beyond your gateway. Check your local routing table. Here's mine:

Code:
$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags         Netif Expire
default            10.0.10.1          UGS             re0
10.0.10.0/24       link#1             U               re0
10.0.10.26         link#2             UHS             lo0
127.0.0.1          link#2             UH              lo0

Yours should show a 'default' line that has 172.20.1.254 as its gateway. If it doesn't, try restarting routing:

Code:
#/etc/rc.d/routing restart

..or just do a reboot, and check your tables again. It should definitely have picked up your gateway by now and things should be working.
 
resolvconf(8) is used to maintain the information from the DHCP and ppp or other VPN service to update the/etc/resolv.conf file. It's not used to retrieve the information from the file.
So when you configure your static IP address and put static DNS nameservers in/etc/resolv.conf you will not get any information back using resolvconf -l command.
If you want to see if your DNS is working you can use the host command or drill to query the IP address from the hostname for example:
host bing.com
bing.com has address 150.171.27.10
bing.com has address 150.171.27.10
bing.com has IPv6 address 2620:1ec:33::10
bing.com has IPv6 address 2620:1ec:33:1::10

# drill bing.com
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 37224
;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; bing.com. IN A

;; ANSWER SECTION:
bing.com. 5 IN A 150.171.28.10
bing.com. 5 IN A 150.171.27.10

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 7 msec
;; SERVER: 8.8.8.8
;; WHEN: Thu Nov 20 15:47:44 2025
;; MSG SIZE rcvd: 58


Your DNS port 53 may be filtered or redirected by your ISP and all requests on that port may be blocked. You can test this by trying to connect to the port 53 using telnet or nc
nc -v -z 8.8.8.8 53

# nc -v -z 8.8.8.8 53
Connection to 8.8.8.8 53 port [tcp/domain] succeeded!
 
Does ping 8.8.8.8 work? If not you should check the configuration of that gateway host itself. You probably forgot it should NAT that outgoing traffic. Or the gateway host itself has no internet connection. The problem isn't on this host in any case, it's on that gateway host.
 
Dear all :
thanks for your help... yes ,
i can ping 1.1.1.1 and 8.8.8.8
can not ping bing.com

i think i have lost dns .. where we can configure it in fixing IP and gateway..thanks.
 
Back
Top