LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-06-2018, 02:03 AM   #1
QWE123
Member
 
Registered: Nov 2014
Posts: 55

Rep: Reputation: Disabled
change DNS


I have a redhat 7 web server .

There is no GUI installed ( for some reason , the GUI is unable to install )

I want to change DNS configuration , as I know it is not work to directly update the file /etc/resolv.conf , therefore , I would like to ask is there any method to update DNS without GUI ?

Last edited by QWE123; 03-06-2018 at 02:44 AM.
 
Old 03-06-2018, 02:43 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by QWE123 View Post
I have a redhat 7 server .

There is no GUI installed ( for some reason , the GUI is unable to install )

I want to change DNS configuration , as I know it is not work to directly update the file /etc/resolv.conf , therefore , I would like to ask is there any method to update DNS without GUI ?
Edit /etc/sysconfig/network-scripts/ifcfg-ethX (where X is the number of your ethernet card) and add/change
Code:
DNS1=x.x.x.x
DNS2=y.y.y.y
Mind that your NIC could be named other than ethX, in which case you need to edit the proper /etc/sysconfig/network-scripts/ifcfg-<something> file

Regards
 
1 members found this post helpful.
Old 03-06-2018, 02:49 AM   #3
QWE123
Member
 
Registered: Nov 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
thanks reply ,

Just would like to know how can I confirm the DNS is properly applied after updated the configuration ( withoth GUI ) , if the settings is updated in /etc/resolv.conf , is that mean the DNS is properly applied ?
 
Old 03-06-2018, 03:02 AM   #4
tocii.
LQ Newbie
 
Registered: Jan 2018
Distribution: Ubuntu, Mint
Posts: 27

Rep: Reputation: Disabled
You need to restart the service to confirm.
 
Old 03-06-2018, 03:05 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by QWE123 View Post
thanks reply ,

Just would like to know how can I confirm the DNS is properly applied after updated the configuration ( withoth GUI ) , if the settings is updated in /etc/resolv.conf , is that mean the DNS is properly applied ?
Yes, if you see the nameserver(s) you used in ifcfg-ethX in /etc/resolv.conf, it means that the changes are done. Or else you need to restart the network as tocii said.

To test, you can run:
Code:
dig +short www.linuxquestions.org
 
Old 03-07-2018, 07:56 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,650

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by QWE123 View Post
I have a redhat 7 web server .
There is no GUI installed ( for some reason , the GUI is unable to install )
Most probably, because you haven't PAID FOR RHEL, and as such, don't have access to the repositories. You've been asking about RHEL for years now, and have received the same advice over and over: either pay for RHEL, or use CentOS.
Quote:
I want to change DNS configuration , as I know it is not work to directly update the file /etc/resolv.conf , therefore , I would like to ask is there any method to update DNS without GUI ?
Did you open that file? Because in the ones I have, I have this at the top:
Code:
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
...that tells you what to edit. Also, "DNS configuration" is a bit vague. Are you RUNNING DNS on this system, or do you mean you just want to change the nameservers the system points to?
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I change the DNS in Ubuntu 10.04 kanthas Linux - Newbie 24 11-23-2011 04:53 AM
How to change the DNS lemon09 Linux - Networking 6 01-28-2010 02:54 PM
How to set DNS servers? How to stop auto change of DNS servers? newtovanilla Linux - Newbie 1 10-29-2008 09:19 PM
how can i change dns in mandrake10 piton Linux - Networking 1 10-06-2004 09:40 AM
Change dns ip guanyu Linux - Networking 4 08-19-2003 02:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration