DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th May 2009
sputnik's Avatar
sputnik sputnik is offline
Port Guard
 
Join Date: Mar 2009
Posts: 23
Thanked 0 Times in 0 Posts
Default dhcpd and dns

Hi.

My openbsd machine is firewall/gateway and dhcp server for other computers at my office. Now the computers uses ISP dns for resolving hostnames, but i'd like them to use my openbsd for name resolving. So i can change
"option domain-name-servers dns.of.my.isp;" to
"option domain-name-servers 192.168.1.1;",
which is the address of openbsd internal interface, but that's not enough, though. Is there something i'm missing in resolv.conf, or i just have to run named for such intentions?

Thanks.
Reply With Quote
  #2   (View Single Post)  
Old 7th May 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,894
Thanked 214 Times in 189 Posts
Default

It should work, unless there's some other problem with your configuration.

Here's an example excerpt from a fairly simple SOHO configuration. The "routers" option is in the subnet as this router provides DHCP to multiple NICs:
Code:
option domain-name "example.com";
option domain-name-servers 192.168.1.1;

subnet 192.168.1.0 netmask 255.255.255.0 {
             option routers 192.168.1.1;
             range 192.168.1.100 192.168.1.200;
}
Reply With Quote
  #3   (View Single Post)  
Old 7th May 2009
sputnik's Avatar
sputnik sputnik is offline
Port Guard
 
Join Date: Mar 2009
Posts: 23
Thanked 0 Times in 0 Posts
Default

Hm, but it doesn't..
There's mine:

Code:
shared-network LOCAL-NET {
        option  domain-name "my.hostname.it";
        option  domain-name-servers 192.168.1.1;

        subnet 192.168.1.0 netmask 255.255.255.240 {
                option routers 192.168.1.1;
                range 192.168.1.2 192.168.1.14;
                default-lease-time 86400; #24h
                max-lease-time 172800; #48h
        }
}
Reply With Quote
  #4   (View Single Post)  
Old 7th May 2009
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,894
Thanked 214 Times in 189 Posts
Default

Clients can override server "recommendations" -- if the clients are still pointing at your ISP's DNS address(es), I'd look at your client configurations.
Reply With Quote
  #5   (View Single Post)  
Old 7th May 2009
sputnik's Avatar
sputnik sputnik is offline
Port Guard
 
Join Date: Mar 2009
Posts: 23
Thanked 0 Times in 0 Posts
Default

It's ok with clients configuration, i mean client gets 192.168.1.1 as dns server. The problem is the server doesn't resolves hostnames. I mean server it self doesn't work as resolver...
Reply With Quote
  #6   (View Single Post)  
Old 7th May 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

You'll need to configure a recursive DNS server like BIND.. or something similar from the ports tree.
Reply With Quote
  #7   (View Single Post)  
Old 8th May 2009
sputnik's Avatar
sputnik sputnik is offline
Port Guard
 
Join Date: Mar 2009
Posts: 23
Thanked 0 Times in 0 Posts
Default

I thought so, so i've started bind with default configuration adding only one line to named.conf
Code:
forwarders { dns.of.my.isp; };
and now it resolves hostnames, but syslog gives an error messages like this, though it works as i wanted...
Code:
May  7 11:59:54 myhostname named[27303]: client 192.168.1.6#1026: RFC 1918 response from Internet for 6.1.168.192.in-addr.arpa
May  7 12:45:35 myhostname named[27303]: client 192.168.1.5#1025: RFC 1918 response from Internet for 5.1.168.192.in-addr.arpa
Could i get rid of this messages somehow?
Reply With Quote
  #8   (View Single Post)  
Old 8th May 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

BIND is forwarding the lookup of IN-ADDR.ARPA zones to your ISP's DNS server, this isn't the proper way of doing it.

You can create your own master zone to get around this,
/var/named/etc/named.conf
Code:
...
zone "1.168.192.in-addr.arpa" {
    type master;
    file "master/1.168.192.in-addr.arpa";
};
/var/named/master/1.168.192.in-addr.arpa
Code:
$ORIGIN 1.168.192.in-addr.arpa.
$TTL 24h 

@	IN	SOA	mydomain. root.localhost. (
			2009050801	; serial
			8h	; refresh
			2h	; retry
			10d	; expiration
			24h )	; minimum

		NS	mydomain.
1	IN	PTR	myhostname.mydomain.
5	IN	PTR	clienthost1.mydomain.
6	IN	PTR	clienthost2.mydomain.
You might also want to add a zone for the domain you're using, if it doesn't really exist that is..
Reply With Quote
  #9   (View Single Post)  
Old 8th May 2009
sputnik's Avatar
sputnik sputnik is offline
Port Guard
 
Join Date: Mar 2009
Posts: 23
Thanked 0 Times in 0 Posts
Default

Brilliant. Thank you, this is absolutely what i needed.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcpd, vista and wlan hamba FreeBSD Ports and Packages 5 8th September 2009 04:34 PM
dhcpd and multiple subnets vdubjunkie OpenBSD General 5 11th March 2009 11:02 PM
dhcpd within ezjail? zelut FreeBSD General 7 10th February 2009 10:31 PM
dhcpd:No Buffer space avaible marsjanq OpenBSD General 8 13th September 2008 07:52 PM
dhcpd problems... dynamic and static leases present edhunter FreeBSD General 7 16th May 2008 02:34 PM


All times are GMT. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick