local web server

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Author Message
aloysiousb
DD-WRT Novice


Joined: 14 Sep 2020
Posts: 5

PostPosted: Mon Sep 14, 2020 18:27    Post subject: local web server Reply with quote
Apologies if this is not in the correct forum, or has been asked before (I never seem to have luck with the search).
I am using the x86 version v24-sp1 (07/26/0Cool std - build 9994

I am using DNSMasq for dhcp and under Additional DNSMasq Options I have

Code:
dhcp-range=192.168.2.1,192.168.10.254,15m
dhcp-option=6,XX.XX.XXX.XX,YY.YY.YYY.YY

Yes, that is a wide range... BTW XX and YY are my ISP DNS servers.

This is used to provide free wifi to cell users in a cafeteria.

I am setting up a webserver for LAN use only, and would like to have all 1-word web addresses (e.g. "news" or "http://news") pass through the webserver and if not found there continue on to the ISP DNS servers for name resolution (or google search, etc.)

I believe I can add an additional DNSMasq option to handle this, but I do not need to install a DNS server (at least I think I do not) as the webserver can translate the 1-word name (if added to the apache host file).

I am willing to read if someone knows of a good tutorial to accomplish this.

Thanks
Sponsor
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 807

PostPosted: Mon Sep 14, 2020 23:36    Post subject: Reply with quote
dnsmasq is acting as a dns forwarder, you could just use that and then have it cache/forward and help resolve.

then you could do something like:

addn-hosts=/etc/dnsmasq.hosts

and in that file have all of the mappings:

172.217.15.78 google

but suggest you read:

http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
aloysiousb
DD-WRT Novice


Joined: 14 Sep 2020
Posts: 5

PostPosted: Wed Sep 16, 2020 12:37    Post subject: Reply with quote
That sounds quite straight forward.

Only problem is I get an error of "file system read-only" when I attempt to create the dnsmasq.hosts file

I was able to add an entry to /etc/hosts but it does not seem to do the job
*edit* the edit I made to /etc/hosts did not remain after a reboot *edit*
aloysiousb
DD-WRT Novice


Joined: 14 Sep 2020
Posts: 5

PostPosted: Wed Sep 16, 2020 14:12    Post subject: Reply with quote
OK, so I have seen suggestions to mount a USB stick and create my files in there, but I cannot seem to find the drive to mount it.
Using
Code:
dmesg | tail -5
I was able to see the USB at the time I plugged it in
Code:
Every 2s: dmesg | tail -5                                   2020-09-16 09:56:03
scsi6 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 6:0:0:0: Direct-Access     TOSHIBA  silicon-power    PMAP PQ: 0 ANSI: 4

So how do I mount that? I was expecting to see something similar to my regular drive
Code:
hda: KINGSTON SUV500240G, ATA DISK drive
Probing IDE interface ide1...
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 512KiB
hda: 468862128 sectors (240057 MB), CHS=29185/255/63
hda: cache flushes supported
 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 p4

What am I missing, this is a flash drive formatted FAT32 I have enabled USB support in the web gui

Thanks
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 807

PostPosted: Wed Sep 16, 2020 21:22    Post subject: Reply with quote
I was thinking about the startup script would be easiest and the additional dnsmasq options.

for mounting usb I would read:

https://wiki.dd-wrt.com/wiki/index.php/USB_storage
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 3787
Location: UK, London, just across the river..

PostPosted: Thu Sep 17, 2020 6:48    Post subject: Reply with quote
another useful way to mount usb

https://pastebin.com/VDZ32r2D

_________________
Atheros
TP-Link WR740Nv1 ------DD-WRT 44251 BS AP,NAT
TP-Link WR740Nv4 ------DD-WRT 44251 BS WAP/Switch
TP-Link WR1043NDv2 ----DD-WRT 444406 BS AP,NAT,AP Isolation,Firewall,Local DNS,Forced DNS,DoT,VPN
TP-Link WR1043NDv2 ----DD-WRT 44340 BS AP,NAT,AD Block,Firewall,Local DNS,Forced DNS,DoT,VPN
TP-Link WR1043NDv2 ----Gargoyle OS 1.12.0 AP,NAT,QoS,Quotas
Qualcomm/IPQ8065
Netgear R7800 -------DD-WRT 44340 BS AP,NAT,AD-Block,AP&Net Isolation,VLAN's,Firewall,Local DNS,DoT
Broadcom
Netgear R7000 -------DD-WRT 44340 BS AP,Wi-Fi OFF,NAT,AD-Block,Firewall,Local DNS,Forced DNS,DoT,VPN
------------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 146

PostPosted: Fri Sep 18, 2020 4:19    Post subject: Reply with quote
Couldn't you use a bunch of "Additional Dnsmasq Options"

address=/news/192.168.1.2
address=/announcements/192.168.1.3
address=/faq/192.168.1.3
...

It's stored in nvram so no USB stick required but if you have thousands instead of dozens of addresses then a USB stick is needed.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions All times are GMT

Navigation

 
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
You can attach files in this forum
You can download files in this forum