11-22-2023
02:15 AM
- last edited on
11-24-2023
12:58 PM
by
Translator
Hi,
I am trying to set up a DNS server on the router for my local network, these are my configs:
Current configuration : 1439 bytes
!
! Last configuration change at 00:14:16 UTC Tue Jan 9 1900
!
version 15.1
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Labnet
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$Ui8u$eoLJUOpxlga4iYrqK6pvX/
enable password *******************
!
no aaa new-model
memory-size iomem 10
crypto pki token default removal timeout 0
!
!
ip source-route
!
!
!
ip dhcp excluded-address 192.168.15.1 192.168.15.2
!
ip dhcp pool labnet
network 192.168.15.0 255.255.255.0
dns-server 192.168.15.1
default-router 192.168.15.1
domain-name example.local
!
ip dhcp pool MAINSERVER
host 192.168.15.3 255.255.255.0
client-identifier ****.****.****.**
!
!
ip dhcp update dns both override
ip cef
ip host gerrit.example.local 192.168.15.3
no ipv6 cef
!
!
license udi pid CISCO881-K9 sn FCZ1517C5M7
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0
!
interface FastEthernet1
!
interface FastEthernet2
shutdown
!
interface FastEthernet3
shutdown
!
interface FastEthernet4
no ip address
shutdown
duplex auto
speed auto
!
interface Vlan1
ip address 192.168.15.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip dns server
ip dns spoofing
!
logging esm config
!
!
!
!
!
line con 0
no modem enable
line aux 0
line vty 0 4
password *******************
login
transport input all
!
end
I have a server that I want to give the domain name gerrit.example.local. Pinging gerrit.example.local from the router works fine, but when I try to access gerrit.example.local from another computer on the network it does not work:
$ nslookup gerrit.example.local
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: gerrit.example.local
Address: 192.168.15.1
;; connection timed out; no servers could be reached
$ nslookup gerrit.example.local 192.168.15.1
Server: 192.168.15.1
Address: 192.168.15.1#53
Non-authoritative answer:
Name: gerrit.example.local
Address: 192.168.15.1
;; connection timed out; no servers could be reached
I can ping 192.168.15.3 so the server can be reached, but the DNS does not work.
The server is connected directly to the FastEthernet1 port and the other computer is connected to FastEthernet0 through an HP switch, if that is relevant. (Also I don't have internet access right now, that is why FastEthernet4 is not configured)
Best regards,
Mattias
Solved! Go to Solution.
11-22-2023
04:42 AM
- last edited on
11-24-2023
01:00 PM
by
Translator
Since you have DNS spoofing enabled on the router, consider temporarily disabling it to see if it affects the behavior. The
ip dns spoofing
command can sometimes cause unexpected issues.
11-22-2023
02:46 AM
- last edited on
11-24-2023
12:59 PM
by
Translator
R1# configure terminal
R1(config)# ip dns server
R1(config)# ip domain-lookup
You need above to make router work as DNS
11-22-2023 03:56 AM - edited 11-22-2023 06:01 AM
I open via PC is see command.
MHM
11-22-2023 04:49 AM
ip dns server is active, see the config in the first post.
11-22-2023 02:47 AM
Helo @matjxa
ip domain-lookup is configured ?
11-22-2023 03:27 AM
Hello,
ip domain-lookup is configured (I guess it doesn't show up in running-config because it's on by default?), but it still doesn't work.
If I check systemd-resolve --status on the other computer it recognizes the router as a DNS server, so I don't understand why it doesn't work:
$ systemd-resolve --status
Link 2 (enp0s31f6)
Current Scopes: DNS
DefaultRoute setting: yes
LLMNR setting: yes
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
Current DNS Server: 192.168.15.1
DNS Servers: 192.168.15.1
DNS Domain: ~.
example.local
11-22-2023
04:42 AM
- last edited on
11-24-2023
01:00 PM
by
Translator
Since you have DNS spoofing enabled on the router, consider temporarily disabling it to see if it affects the behavior. The
ip dns spoofing
command can sometimes cause unexpected issues.
11-22-2023 05:49 AM
I disabled DNS spoofing and now it works!
It seems to be very slow though. When I ping gerrit.example.local it takes around 15 seconds before anything happens. What could be the cause of this?
11-22-2023 06:09 AM
Great @matjxa
Clear the DNS cache on both the router and the client to ensure that you are not dealing with outdated or incorrect DNS entries.
11-22-2023 06:19 AM
Ip dns spoofing
Can slow but not stop dns'
For slow after remove spoofing
Add
Domain name example.local
Check this.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide