Pular para o conteúdo

RESOLV.CONF - PERMANENTE [RESOLVIDO]

Responder tópico
  • Denunciar
  • Indicar

1. RESOLV.CONF - PERMANENTE [RESOLVIDO]

Enviado em 17/02/2013 - 18:14h

Boa Noite,
amigos do VIVAOLINUX, preciso de uma ajudinha com algo que para muitos que tem conhecimento teórico e pratico certamente acharam muito fácil de resolver, quero deixar as configurações abaixo:

search linuxservidor.com.br
search zimbra.linuxservidor.com.br
nameserver 192.168.20.1
nameserver 127.0.0.1

permanentes dentro do "RESOLV.CONF", pois sempre que reinicio o servidor ele se modifica e gostaria que eles fiquem imutáveis e permanentes quando o Servidor fosse reiniciado.

Responder tópico

3. Re: RESOLV.CONF - PERMANENTE [RESOLVIDO]

Enviado em 17/02/2013 - 19:32h

Após edição trava o arquivo com o comando chattr.

* Travando
# chattr +i /etc/resolv.conf

* Destravando
# chattr -i /etc/resolv.conf

4. Re: RESOLV.CONF - PERMANENTE [RESOLVIDO]

Enviado em 18/02/2013 - 14:04h


Valeu a ajuda ai amigos, testei os que me foi passado por você e consegui uma certa parte, então pesquisando mais encontrei isto ai e FUNFOU 100%

vim /etc/resolvconf/resolv.conf.d/head

Editei colocando os arquivos como eu queria assim:

search linuxservidor.com.br
search zimbra.linuxservidor.com.br
nameserver 192.168.20.1
nameserver 127.0.0.1

dei reboot e FUNFOU :)

Obs: sobre os comandos do chattr em algumas versos de SO Linux não e mais possível fazer a alteração com estes comandos infelizmente pelo que andei lendo.

* Travando
# chattr +i /etc/resolv.conf

* Destravando
# chattr -i /etc/resolv.conf


OBTIGADO FRIENDS

5. Re: RESOLV.CONF - PERMANENTE [RESOLVIDO]

Enviado em 18/02/2013 - 20:18h

Qual versão de S.O brother? Em todos esses abaixo ele se tornou imutável.


# cat /etc/issue
Ubuntu 12.04.2 LTS \n \l 
# uname -mrs
Linux 3.2.0-37-generic x86_64 
# cd /etc/
# ls -l resolv.conf
lrwxrwxrwx 1 root root 29 Set 18 14:49 resolv.conf -> ../run/resolvconf/resolv.conf 
# unlink resolv.conf
# cp -a /run/resolvconf/resolv.conf .
# chattr +i resolv.conf
# cat resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
# rm -rf resolv.conf
rm: não foi possível remover “resolv.conf”: Operação não permitida 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


# cat /etc/issue
Welcome to openSUSE 12.2 "Mantis" - Kernel \r (\l). 
# uname -mrs
Linux 3.4.11-2.16-default i686 
# cd /etc/
# ls -lh resolv.conf
-rw-r--r-- 1 root root 833 Fev 18 20:01 resolv.conf 
# chattr +i resolv.conf
# cat resolv.conf
### /etc/resolv.conf file autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
# NETCONFIG_DNS_STATIC_SEARCHLIST
# NETCONFIG_DNS_STATIC_SERVERS
# NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
# NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
# Note: Manual change of this file disables netconfig too, but
# may get lost when this file contains comments or empty lines
# only, the netconfig settings are same with settings in this
# file and in case of a "netconfig update -f" call.
#
### Please remove (at least) this line when you modify the file!
nameserver 8.8.8.8
nameserver 8.8.4.4
# rm -rf resolv.conf
rm: não foi possível remover "resolv.conf": Operação não permitida 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

# cat /etc/issue
Debian GNU/Linux 6.0 \n \l 
# uname -mrs
Linux 2.6.32-5-686 i686 
# cd /etc/
# ls -lh resolv.conf
-rw-r--r-- 1 root root 46 Fev 18 19:59 resolv.conf 
# chattr +i resolv.conf
# cat resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
# rm -rf resolv.conf
rm: não foi possível remover "resolv.conf": Operação não permitida 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago) 
# uname -mrs
Linux 2.6.32-279.el6.x86_64 x86_64 
# cd /etc/
# ls -l resolv.conf
-rw-r--r-- 1 root root 103 Fev  7 15:29 resolv.conf 
# chattr +i resolv.conf
# cat resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
# rm -rf resolv.conf
rm: não foi possível remover "resolv.conf": Operação não permitida 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Abraço!


Responder tópico

Responder tópico

Entre na sua conta para responder.

Fazer login para responder