What's new

Managing Local Hosts File Suggestions

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Again:
Put this in your /jffs/configs/dnsmasq.conf.add
Code:
address=/gateway.specialdomain.com/10.0.1.2
And if your diskstation is on the same net as your router then assign it in LAN / DHCP Server in the Manually assigned DHCP list.
 
Again:
Put this in your /jffs/configs/dnsmasq.conf.add
Code:
address=/gateway.specialdomain.com/10.0.1.2
And if your diskstation is on the same net as your router then assign it in LAN / DHCP Server in the Manually assigned DHCP list.

I tried it this way previously and it doesn't work either :( its not the way I want to do it either as I don't want to be writing to the jffs. As you said this is simple stuff I should have no problem with it so not sure whats going on.

Thanks
Sam
 
Hello,

Have even just tried a factory reset and its still not working, so infuriating. I have checked paths and syntax as per my second post with the various output. Just not sure where to do from here.

Regards,
Sam
 
I'm lost. Exactly what are you trying to accomplish and what exact steps have you taken? This stuff works for everyone else, so there must be something basic you're doing wrong. Please be very specific.

Secondly, I think you are overly concerned about writing to flash. I suspect the router will become obsolete before the flash wears out.
 
Hello,

I basically want to be able to control name resolution at the router level, so if I have intranet.mydomain.com and I place "192.168.1.50 intranet.mydomain.com" in the custom hosts file it should ping/resolve to that IP internally. I know there are other ways to do this but I prefer to manage the hosts file.

So I factory resett got the WAN/LAN sorted.
Enabled SSH
Enabled JFFS and told to format on next boot
Rebooted

Logged in VIA SSH
vi /jffs/configs/dnsmaswq.conf.add
Added: addn-hosts=/tmp/mnt/USB1/hosts
Save :)wq)

cd /tmp/mnt/USB1
vi hosts
Added: 192.168.1.50 intranet.mydomain.com
Save :)wq)

service restart_dnsmasq

ping intranet.mydomain.com
Doesn't ping (unknown address)

Reboot

ping intranet.mydomain.com
Doesn't ping (unknown address

Thanks
Sam
 
This should work. Thats all I can say.
Just make sure your typo in your post is not what you've typed in the console...
 
  1. Edit /jffs/config/hosts.add to add the line you want.
  2. Reboot.
Just for you, I added the line
Code:
192.168.100.1 intranet.mydomain.com
in hosts.add and rebooted. That happens to be the LAN address of my cable modem. I have no trouble pinging it.
Code:
# ping intranet.mydomain.com
PING intranet.mydomain.com (192.168.100.1): 56 data bytes
64 bytes from 192.168.100.1: seq=0 ttl=64 time=2.063 ms
64 bytes from 192.168.100.1: seq=1 ttl=64 time=0.521 ms
64 bytes from 192.168.100.1: seq=2 ttl=64 time=0.506 ms
64 bytes from 192.168.100.1: seq=3 ttl=64 time=0.521 ms

--- intranet.mydomain.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.506/0.902/2.063 ms

It gets added to /etc/hosts:
Code:
# tail -1 /etc/hosts
192.168.100.1 intranet.mydomain.com
 
vi /jffs/configs/dnsmaswq.conf.add
 
Its /jffs/configs/dnsmasq.conf.add
 
vi /jffs/configs/dnsmaswq.conf.add

Hello,

Yes was just a typo as it has the correct name on the router.

uname@RT-AC66U:/jffs/configs# ls -la
-rw-rw-rw- 1 uname root 39 Apr 17 23:26 dnsmasq.conf.add

Its also added to the bottom of the dnsmasq.conf file.

admin@RT-AC66U:/tmp/etc# cat dnsmasq.conf
pid-file=/var/run/dnsmasq.pid
user=nobody
resolv-file=/tmp/resolv.conf
no-poll
min-port=4096
bind-dynamic
interface=br0
no-negcache
cache-size=1500
dhcp-range=lan,192.168.1.2,198.168.1.254,255.255.255.0,86400s
dhcp-lease-max=253
dhcp-authoritative
dhcp-option=lan,3,192.168.1.1
addn-hosts=/tmp/mnt/USB1/hosts
 
dumb question, can you ping 10.0.1.2
Your LAN settings suggest you are using standard settings
 
And to add, ping it from the routers console and from a pc.
 
dumb question, can you ping 10.0.1.2
Your LAN settings suggest you are using standard settings

Yes I was using 10.0.1.2 until I factory reset, so was using 198.x. Its now since switched back to 10.0.1.1 range.

Can ping 10.0.1.2

PING 10.0.1.2 (10.0.1.2): 56 data bytes
64 bytes from 10.0.1.2: seq=0 ttl=64 time=0.692 ms
64 bytes from 10.0.1.2: seq=1 ttl=64 time=0.418 ms
64 bytes from 10.0.1.2: seq=2 ttl=64 time=0.417 ms
64 bytes from 10.0.1.2: seq=3 ttl=64 time=0.439 ms
64 bytes from 10.0.1.2: seq=4 ttl=64 time=0.398 ms
64 bytes from 10.0.1.2: seq=5 ttl=64 time=0.411 ms

--- 10.0.1.2 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 0.398/0.462/0.692 ms
 
Hello,

That ping above was from the router and this ping is from the computer.

ping 10.0.1.2
PING 10.0.1.2 (10.0.1.2): 56 data bytes
64 bytes from 10.0.1.2: icmp_seq=0 ttl=64 time=0.697 ms
64 bytes from 10.0.1.2: icmp_seq=1 ttl=64 time=0.345 ms
64 bytes from 10.0.1.2: icmp_seq=2 ttl=64 time=0.338 ms
64 bytes from 10.0.1.2: icmp_seq=3 ttl=64 time=0.347 ms
^C
--- 10.0.1.2 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.338/0.432/0.697/0.153 ms
 
what is nslookup saying?
 
Helllo,

Okay so I edited the /etc/resolv.conf

Added: nameserver 127.0.0.1

That seems to have fixed it.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top