Using the internal DNS

Support section for FREESCO v0.4.x

Using the internal DNS

Postby bec » Mon Apr 21, 2014 2:04 am

Hi,
I've been playing with the internal DNS and can't figure out how it works. I have added entries for 2 devices: wpad (192.168.101.1 - the router) and printer (192.168.101.241)

When I do an nslookup on the Freesco box for wpad or printer it resolves, but wpad.inet and printer.inet fail. When I nslookup from a PC I get the same.

In the router logs I see this:
Apr 21 16:56:18 - dnsmasq[22423]: /etc/hosts 192.168.101.1 is router
Apr 21 16:56:18 - dnsmasq[22423]: /etc/hosts 192.168.101.1 is wpad
Apr 21 16:56:18 - dnsmasq[22423]: query wpad.inet from 192.168.101.60
Apr 21 16:56:18 - dnsmasq[22423]: cached wpad.inet is <NXDOMAIN>-IPv4
Apr 21 16:56:18 - dnsmasq[22423]: query wpad.inet from 192.168.101.60
Apr 21 16:56:18 - dnsmasq[22423]: forwarded wpad.inet to 198.142.235.14
Apr 21 16:56:18 - dnsmasq[22423]: query wpad.inet from 192.168.101.60
Apr 21 16:56:18 - dnsmasq[22423]: cached wpad.inet is <NXDOMAIN>-IPv4
Apr 21 16:56:18 - dnsmasq[22423]: query wpad.inet from 192.168.101.60
Apr 21 16:56:18 - dnsmasq[22423]: forwarded wpad.inet to 198.142.235.14

What have I missed?

The version is 0.4.3, I could upgrade, but it is a HDD installation and I forget all the customisations I have to carry over, so was hoping to solve it here.

I do have the Hosts package installed, not sure if this complicates things.

Thanks for your interest and help

Brian
You do not have the required permissions to view the files attached to this post.
User avatar
bec
Member
 
Posts: 68
Joined: Sat Jun 29, 2002 8:37 am
Location: Melbourne, Australia

Re: Using the internal DNS

Postby Lightning » Mon Apr 21, 2014 9:38 am

Double check your configuration in the /etc/dns.cfg file and make sure that you have an entry like this

192.168.xx.xx <TAB> wpad <TAB> wpad.inet

Then use

rc_dns restart

If you make changes to the /etc/dnbs.cfg file make sure to copy it to the /boot/etc/ directory to survive a reboot. However if this is all correct I can tell you how to modify the rc_dns script to the 0.4.5 version and probably resolve this issue.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Using the internal DNS

Postby bec » Tue Apr 22, 2014 7:47 am

I had edited hosts from the setup script and restarted the dns. I've attached a screen shot of the setup dialog. It looks to me as though there are tabs in the correct places. So I wonder if I don't need to edit therc_dns restart script as you propose.

Even on the router I still get this:
Code: Select all
 
[root@router] rc_dns restart
Stopping dnsmasq....                         Done
Starting DNS...                              Done  port 53      secure
[root@router] nslookup wpad
Server:  localhost
Address:  127.0.0.1

Name:    wpad
Address:  192.168.101.1

[root@router] nslookup wpad.inet
Server:  localhost
Address:  127.0.0.1

*** localhost can't find wpad.inet: Non-existent host/domain


I notice that only the bare hostname will lookup, FQDN won't look up.

Thanks
Brian
You do not have the required permissions to view the files attached to this post.
User avatar
bec
Member
 
Posts: 68
Joined: Sat Jun 29, 2002 8:37 am
Location: Melbourne, Australia

Re: Using the internal DNS

Postby Island » Tue Apr 22, 2014 10:45 am

You might be able to obtain an extra clue from the 'recent log' in the control panel.

If you have set DNS logging to 'y', and then you do:

Code: Select all
nslookup wpad
[check the response]

nslookup wpad.inet
[check the response]


the 'recent log' will show the DNS resolution of both wpad, and wpad.inet.

If the hosts file is being used, the log will say something such as :

Code: Select all
/etc/hosts wpad is a.b.c.d


and you know that /etc/hosts is being used, successfully.

If 'recent log' logs a message to say that wpad.inet cannot be found, that implies that the /etc/hosts (or, perhaps, the rebootable copy of dns.cfg) does not contain the entry for wpad.inet. Such a log might point to file version or access problems.

This could help distingush between (a) file access problems, or (b) possible other functional failures such as in the dns script or the dns resolver program.

regards, Island
User avatar
Island
Junior Advanced Member
 
Posts: 117
Joined: Sat Jan 22, 2005 12:48 pm

Re: Using the internal DNS

Postby Lightning » Tue Apr 22, 2014 11:15 am

If 'recent log' logs a message to say that wpad.inet cannot be found, that implies that the /etc/hosts (or, perhaps, the rebootable copy of dns.cfg) does not contain the entry for wpad.inet. Such a log might point to file version or access problems.
Be aware that the /etc/hosts file is a dynamic file, meaning that it is rewritten every time the rc_dns is restarted. The only file(s) that are static are the /etc/dns.cfg and the /boot/etc/dns.cfg file that will survive a reboot. So when you say that you edited the hosts file and restarted the DNS server it makes me wonder???

However with that you can additionally try these commands
Code: Select all
cd /pkg/rc
snarf lewis.freesco.net/tmp/rc_dns
chmod +x rc_dns
rc_hosts restart #If the hosts package is installed
rc_dns restart
If there are any entries you need to add make sure you use the /etc/dns.cfg file and copy it to /boot/etc/ when done.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Using the internal DNS

Postby bec » Wed Apr 23, 2014 5:19 am

Thanks ,

Here is what I found
I ran these commands:
Code: Select all
      _/_/_/_/ _/_/_/_/  _/_/_/_/ _/_/_/_/ _/_/_/_/ _/_/_/_/ _/_/_/_/
     _/       _/     _/ _/       _/       _/       _/       _/    _/  v0.4.3
    _/_/_/   _/_/_/_/  _/_/_/   _/_/_/   _/_/_/_/ _/       _/    _/   Powered
   _/       _/  _/    _/       _/             _/ _/       _/    _/      by
  _/       _/    _/  _/_/_/_/ _/_/_/_/ _/_/_/_/ _/_/_/_/ _/_/_/_/      LiNUX

ile rev 2.7freesco
[root@router] nslookup wpad
Server:  localhost
Address:  127.0.0.1

Name:    wpad
Address:  192.168.101.1

[root@router] nslookup wpad.inet
Server:  localhost
Address:  127.0.0.1

*** localhost can't find wpad.inet: Non-existent host/domain
[root@router]


and this is the log (without some facebook lookups)

Code: Select all
Apr 23 20:13:41 - dnsmasq[28558]: /etc/hosts 127.0.0.1 is localhost
Apr 23 20:13:41 - dnsmasq[28558]: query wpad.inet from 127.0.0.1
Apr 23 20:13:41 - dnsmasq[28558]: cached wpad.inet is <NXDOMAIN>-IPv4
Apr 23 20:13:41 - dnsmasq[28558]: query wpad from 127.0.0.1
Apr 23 20:13:41 - dnsmasq[28558]: /etc/hosts wpad is 192.168.101.1

Apr 23 20:14:10 - dnsmasq[28558]: query wpad.inet from 192.168.101.59
Apr 23 20:14:10 - dnsmasq[28558]: cached wpad.inet is <NXDOMAIN>-IPv4
Apr 23 20:14:15 - dnsmasq[28558]: query 1.0.0.127.in-addr.arpa from 127.0.0.1
Apr 23 20:14:15 - dnsmasq[28558]: /etc/hosts 127.0.0.1 is localhost
Apr 23 20:14:15 - dnsmasq[28558]: query router.inet from 127.0.0.1
Apr 23 20:14:15 - dnsmasq[28558]: /etc/hosts router.inet is 192.168.101.1

Apr 23 20:14:21 - dnsmasq[28558]: query 1.0.0.127.in-addr.arpa from 127.0.0.1
Apr 23 20:14:21 - dnsmasq[28558]: /etc/hosts 127.0.0.1 is localhost
Apr 23 20:14:21 - dnsmasq[28558]: query wpad.inet from 127.0.0.1
Apr 23 20:14:21 - dnsmasq[28558]: cached wpad.inet is <NXDOMAIN>-IPv4
Apr 23 20:14:21 - dnsmasq[28558]: query wpad.inet.inet from 127.0.0.1
Apr 23 20:14:21 - dnsmasq[28558]: forwarded wpad.inet.inet to 198.142.235.14
Apr 23 20:14:21 - dnsmasq[28558]: reply wpad.inet.inet is <NXDOMAIN>-IPv4


It seems like the domain is autmatically being added even when it is specified. This causes the DNS lookup to fail.

I haven't applied the solution suggested yet. Should I do it now?

Brian
User avatar
bec
Member
 
Posts: 68
Joined: Sat Jun 29, 2002 8:37 am
Location: Melbourne, Australia

Re: Using the internal DNS

Postby Island » Wed Apr 23, 2014 6:53 am

bec, I've got a very similar problem, and I am interesed in the solution. Before Lewis answers, might you be able to post the (relevant) content of both

/etc/dns.cfg

and

/boot/etc/dns.cfg

so that there can be no doubt that the data contents are correct, and are 'in view' of dnsmasq, as it were? That then would seem to suggest there is some other factor at issue.

regards, Island
User avatar
Island
Junior Advanced Member
 
Posts: 117
Joined: Sat Jan 22, 2005 12:48 pm

Re: Using the internal DNS

Postby Lightning » Wed Apr 23, 2014 11:03 am

I haven't applied the solution suggested yet. Should I do it now?
Yes, there is nothing to loose if it doesn't help and if it doesn't work or there is a problem you can just remove the new rc_dns script.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Re: Using the internal DNS

Postby bec » Thu Apr 24, 2014 5:17 pm

Lewis,

Thanks for your help. This seems to be working fine.

To close out the other question from Island, effectively the screen shot in an earlier post shows the contents of hosts.cfg. For completeness I'll post it.
Code: Select all
[root@router] more /etc/dns.cfg
# Put all static IP's on your network here.
# Multiple names and domains can be entered for each IP using TAB's as
# separators.

# 192.168.1.10  mycomputer      mycomputer.inet fred    fred.inet
192.168.101.3   TheVault        TheVault.inet
192.168.101.250 ap      ap.inet
192.168.101.241 printer printer.inet
192.168.101.1   wpad    wpad.inet[root@router]


Code: Select all
[root@router] more /boot/etc/dns.cfg
# Put all static IP's on your network here.
# Multiple names and domains can be entered for each IP using TAB's as
# separators.

# 192.168.1.10  mycomputer      mycomputer.inet fred    fred.inet
192.168.101.3   TheVault        TheVault.inet
192.168.101.250 ap      ap.inet
192.168.101.241 printer printer.inet
192.168.101.1   wpad    wpad.inet[root@router]


Thanks again for your help

Brian
User avatar
bec
Member
 
Posts: 68
Joined: Sat Jun 29, 2002 8:37 am
Location: Melbourne, Australia

Re: Using the internal DNS

Postby Lightning » Thu Apr 24, 2014 11:46 pm

Thanks for your help. This seems to be working fine.
I am glad it is working and for general information this was the reason to some extent why the rc_dns script was rewritten in 0.4.5 to prevent dialouts for local DNS lookups. Which is the script that was posted with only the shell changed to /bin/sh from /bin/ash as it is in 0.4.5

There were a LOT of other changes in 0.4.5 to make it compatible with a gcc compiler and bash. However I strongly recommend against installing the gcc package on a routing machine. But it is capable of making it's own custom kernels and or compiling C source code and the gcc package requires version 0.4.5 or newer.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA


Return to FREESCO Support for v0.4.x

Who is online

Users browsing this forum: No registered users and 2 guests

cron