LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-22-2018, 04:21 PM   #1
Aniruddhaaaaaaa
LQ Newbie
 
Registered: May 2018
Posts: 4

Rep: Reputation: Disabled
Compare resolv.conf IP with given IP as input


I want to input IP (may be 2 or 3 IPs)
It will compare that IP with the IP present in resolv.conf.
If all IP present then output should be good else it will show the resolv.conf file content.
 
Old 05-22-2018, 06:35 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
What have you tried?
Sounds like you want to read one or more IP addresses, grep each to see if in resolv.conf, and report accordingly.

Wonder why you don't just look at the contents of resolv.conf? What problem are you trying to solve?
 
1 members found this post helpful.
Old 05-23-2018, 11:29 AM   #3
Aniruddhaaaaaaa
LQ Newbie
 
Registered: May 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
What have you tried?
Sounds like you want to read one or more IP addresses, grep each to see if in resolv.conf, and report accordingly.

Wonder why you don't just look at the contents of resolv.conf? What problem are you trying to solve?
I need to check that IPs are present in resolv.conf for multiple server or not through one command by SSH
 
Old 05-23-2018, 11:34 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Aniruddhaaaaaaa View Post
I need to check that IPs are present in resolv.conf for multiple server or not through one command by SSH
Ok...so you'll have to write a script. Just restating your question doesn't tell us anything new; read the "Question Guidelines" and "How to ask a smart question" links in my posting signature.

Again, post what you have written/done/tried so far and we'll be happy to help, but we aren't going to write a script for you. You also have to define things, such as saying where the input IP addresses are coming from, etc.
 
  


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
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
About /etc/resolv.conf satimis Linux - Networking 10 02-24-2006 09:30 PM
resolv.conf stanleytiew Linux - Newbie 2 05-13-2005 04:25 PM
resolv.conf jmdlcar Slackware 9 05-15-2004 11:44 AM
resolv.conf ricemark20 Linux - Networking 12 11-11-2003 04:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:54 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