How to use static dns with pppoe?

Asked by doclist

How do I use static DNS with pppoe?

I have a Jaunty server acting as a router. I want to use static DNS. I
tried adding a resolv.conf named dsl-provider to /etc/ppp/resolv (per
the pppconfig man page) but this doesn't seem to update
/etc/ppp/resolv.conf or /etc/resolv.conf, both of which seem to still
be using the dynamic DNS. I have removed the usepeerdns option from
pppoe from /etc/ppp/peers/dsl-provider; I have restart pppd-dns; I
have done poff, pon; I have tried using prepending the DNS servers to
dhclient.conf; all with no luck.

This should be easy but it confounds me.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Dennis Prochko
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

you could add the name servers as you expect then run:

sudo cp /etc/ppp/resolv.conf /etc/ppp/resolv.conf_old; sudo cp /etc/resolv.conf /etc/resolv.conf_old

you can then mark the file as read only which may stop any changes happening.

sudo chmod 550 /etc/ppp/resolv.conf; sudo chmod 550 /etc/resolv.conf

If this doesnt help then simply rename the files back. This will restore the original access rights.

Revision history for this message
doclist (dclist) said :
#2

actionparsnip <email address hidden> writes:

> Your question #79165 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/79165
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> you could add the name servers as you expect then run:
>
> sudo cp /etc/ppp/resolv.conf /etc/ppp/resolv.conf_old; sudo cp
> /etc/resolv.conf /etc/resolv.conf_old
>
> you can then mark the file as read only which may stop any changes
> happening.
>
> sudo chmod 550 /etc/ppp/resolv.conf; sudo chmod 550 /etc/resolv.conf
>
> If this doesnt help then simply rename the files back. This will restore
> the original access rights.
>

Thanks, if everything else fails I will do that. However, I would
prefer to use a less hackish solution. Surely there is a mechanism to
define static dns for pppoe?

Revision history for this message
Best Dennis Prochko (wolfsoft) said :
#3

If you are already removed usepeerdns option from your /etc/ppp/peers/provider file and placed your static dns servers into /etc/resolv.conf file, I suppose you have dynamic IP assigned by provider's DHCP, right?

If so, just remove "domain-name-servers" from request line of the /etc/dhcp3/dhclient.conf.

Revision history for this message
doclist (dclist) said :
#4

Thanks, my mistake was not editing /etc/resolv.conf manually. I
thought that the file /etc/ppp/resolv/my-dsl-provider was supposed to
handle updating resolv.conf. (What *does* that file do anyhow?).