Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been trying to setup a samba PDC server using samba 4. This server will also act as firewall for the network, the NAT, backup, security camera storage, etc. The network is small, so one machine should be sufficient. I can't seem to understand how to setup the DNS resolver. The machine needs to see itself as a DNS server, but it also needs to be able to get name-servers from the ISP's DHCP server. Every time I change the resolv.conf file, it gets overwritten when I bring the interface back up to pick up the new name server. Not sure how to configure this to work properly. All the tutorials I have seen say edit resolv.conf.
I suspect your network card has been configured to use DHCP. DHCP will set the values of the /etc/resovl.conf file each time the computer starts.
If you configure your network card to use a fixed i.p. address, the problem should go away. At any rate, it is usually a good idea to use fixed i.p. addresses with servers.
The biggest problem I see is that I don't have a static IP from my ISP, so I have to use DHCP to get on the internet. This is also how I get nameserver information from the ISP (the place this server is going is a non-profit that I believe has a special deal with the phone company, so I have no choice on changing the account type).
Quote:
or make a init script that runs after network and echo's "namserver 127.0.0.1" > /etc/resolv.conf
Is there any good way to make this run every time DHCP changes the file?
The biggest problem I see is that I don't have a static IP from my ISP, so I have to use DHCP to get on the internet. This is also how I get nameserver information from the ISP (the place this server is going is a non-profit that I believe has a special deal with the phone company, so I have no choice on changing the account type).
Typically your ISP will give you a dynamic i.p address for your internet connection. This is what you have. You would then have some type of modem/router device that allows the machines on your local network to communicate with the internet. This device sits between your internal network and the internet.
This modem/router will use dhcp to give out internal i.p. addresses to the machines on your network. If your server is on the internal network it would be receiving an i.p. address from the modem/router and not from the ISP directly.
It is the dhcp from the modem that is resetting your /etc/resolv.conf file. It is unrelated to the address given out by the ISP. Unless you have a non-standard configuration.
Forgot you could just say your modem is your DNS server. Lately, I have had the router deal with PPPoE because I use dyndns to be a remote admin. I guess I can come up with another scheme for that. Thanks. Now I feel dumb.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
if your machine is going to be a server then the best way to do it would be to simply edit the interface (often /etc/network/interfaces) to a static internal IP address, or assign it a static reservation based on mac address (the former is easier the latter is impossible unless you have either a dedicated dhcp server or are running dd-wrt, openwrt or some other custom firmware on your router or have a more expensive commercial router that can create static leases) that way the port forwarding always points to the same machine and the resolv.conf will not be constantly overwriten by the dhcp client.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.