04-19-2020 01:40 PM
Hello,
I am also setting up the router as a DNS server.
I can add "local addresses " with something like:
# ip host mypc 192.168.1.123
I have a dozen hostname/ip's that I'd like in there, can that be done with a file also? (as with the dhcp
static-bindings file)?
Also, I want dhcp to "hand out" the ISP's nameservers, but I believe that is done when you set up
the port to the ISP with dhcp, and use something like "ip nat source list 1 interface Gi0/0 overload" if
Gi0/0 is the port that get configured with dhcp and connects to the ISP (with a modem)?
thanks,
Ron
Solved! Go to Solution.
04-19-2020 01:59 PM
Hello,
I think you can use the 'ip host-list' command to add multiple hosts; a file cannot be referenced, to my best knowledge.
As for handing out DNS servers, they typically are part of the local DHCP pool configured on the router:
ip dhcp pool LAN
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8 8.8.4.4
04-19-2020 01:58 PM
Hi
no dns static file like dhcp static file
dns static entries are as you mentioned - ip host name ip - command
regarding dns for clients, you can configure one or more dns server in the dhcp pool. Clients will get dns server when they get the ip form dhcp.
ip dhcp pool CLIENTS
network 192.168.198.0 255.255.255.0
default-router 192.168.198.1
dns-server 192.168.200.5 192.168.199.5
you can configure google, opendns or your isp dns server here.
04-19-2020 04:11 PM
so I made a "static host" table in dns. and when I ping a hostname from the router, it finds the IP address and pings it.
So next thing I tried is to use nslookup, from a workstation to see if I can get it to reolve a name.
Tried that with 'nslookup mypc.localdomain 192.168.1.123' where 192.168.1.123 the router IP is.
(that IP is working, I use it to ssh into the router).
I did do a 'ip dns server' and 'ip domain-lookup' which would be enough to have the dns service running, right?
Ron
04-19-2020 04:21 PM
ip dns server will resolve the host entries
ip domain-lookup will cause the router to do lookup
that should work ..
you can also configure -
ip name-server 8.8.8.8 8.8.4.4
and configure your client with router's ip as dns in dhcp pool
04-19-2020 04:35 PM
right, that was what I thought, but if I try to do a nslookup and use the router as the 'sever' I get, it is just sitting there waiting until it times out (;; connection timed out; no servers could be reached)
(for now I have not connected it to the WAN yet, I have an issue with DHCP also, the router doesn't respond to dhcp requests.)
04-19-2020 01:59 PM
Hello,
I think you can use the 'ip host-list' command to add multiple hosts; a file cannot be referenced, to my best knowledge.
As for handing out DNS servers, they typically are part of the local DHCP pool configured on the router:
ip dhcp pool LAN
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8 8.8.4.4
04-19-2020 04:39 PM
Hello,
I'll have to try that, 'ip host-list', for now I just copied and pasted it 'manually'
ah, right. yes. However I have machines setup so that they use the router, in 'resolv.conf', So I probably want to setup dns on the router so that it queries the ISP dns servers, or others. right?
Ron
04-19-2020 05:02 PM
04-19-2020 06:43 PM
@omz wrote:
hi
yes thats right.
with ip name-server 8.8.8.8 router will use 8.8.8.8 for dns queries ie. queries from clients that router cant resolve will be forwarded to 8.8.8.8
if with static host entries on router and router ip in resolv.conf of clients you are restricting name resolution to only certain sites then you probably dont want the router to forward a query to 8.8.8.8.
Hi,
well, yes and no. There are several reasons why I am trying to do this.
I am doing "the same thing" on a small RV320 Cisco small business router. It has a bunch of local machines, "mypc.localdomain etc etc) and all machines in the network use that router as their DNS sever. That RV320 gets it's IP from the ISP, as well as the ISP's nameservers.
I want to do the same thing with the Cisco 2900. workstations use the roter as it's DNS server, if it's a local hostname, or private IP address the router will resolve it, and if it is not local, it forwards the request to the ISP's name servers.
When I turn that little RV320 off, and use the Cisco 2900, it gets it's IP address and also the ISP's name servers. When I ping (for example) www.google.com, from the router so that part works.
So what I am trying to figure out is, how I can make the Cisco 2900 DNS service forward to the name-servers it got from the ISP (through DHCP for the WAN address).
Ron
04-19-2020 09:37 PM
We can use "ip host-list" to configure that and as the DHCP configuration includes DNS details so we no need to worry about that.
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